Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return correct block for Scilla CURRENTBLOCK query #2468

Merged
merged 1 commit into from
Mar 10, 2025
Merged

Conversation

JamesHinshelwood
Copy link
Contributor

@JamesHinshelwood JamesHinshelwood commented Mar 7, 2025

The previous implementation incorrectly returned CURRENTBLOCK as the number of the last mined block. This adds a fork which fixes the behaviour to return the current block. Also, the latest block of the chain was always used. Instead we now pass the current block from the execution layer, meaning transactions can be replayed and produce the same result.

This also limits the maximum range of BLOCKHASH and TIMESTAMP queries to 256 blocks from the current block.

@JamesHinshelwood JamesHinshelwood force-pushed the fix-fork branch 2 times, most recently from aa6b650 to 3ad7c12 Compare March 7, 2025 16:11
Copy link
Contributor

github-actions bot commented Mar 7, 2025

🐰 Bencher Report

Branchfix-fork
Testbedself-hosted
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
full-blocks-erc20-transfers/full-blocks-erc20-transfers📈 view plot
🚷 view threshold
1,085.00 ms
(+0.41%)Baseline: 1,080.59 ms
1,427.69 ms
(76.00%)
full-blocks-evm-transfers/full-blocks-evm-transfers📈 view plot
🚷 view threshold
439.66 ms
(+8.61%)Baseline: 404.81 ms
489.09 ms
(89.89%)
full-blocks-zil-transfers/full-blocks-zil-transfers📈 view plot
🚷 view threshold
3,372.90 ms
(-16.44%)Baseline: 4,036.56 ms
5,640.60 ms
(59.80%)
process-empty/process-empty📈 view plot
🚷 view threshold
10.31 ms
(+3.26%)Baseline: 9.98 ms
10.72 ms
(96.14%)
🐰 View full continuous benchmarking report in Bencher

@JamesHinshelwood JamesHinshelwood force-pushed the fix-fork branch 2 times, most recently from 0624fab to f0a164f Compare March 7, 2025 22:27
Instead of always using the latest block of the chain, we pass
the 'current' block from the execution layer. This means the
transactions can be replayed and produce the same result.

This also limits the maximum range of `BLOCKHASH` and `TIMESTAMP`
queries to 256 blocks from the current block.
@JamesHinshelwood JamesHinshelwood added this pull request to the merge queue Mar 10, 2025
Merged via the queue into main with commit ef8c60f Mar 10, 2025
5 of 6 checks passed
@JamesHinshelwood JamesHinshelwood deleted the fix-fork branch March 10, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants