Guillaume Ballet
1599b8f71c
post-genesis transition ( #426 )
...
Support post-genesis transition
Reactivate a post-genesis transition for a kaustinen-like testnet that goes through the conversion.
It adds the ability:
* To undergo the verkle transition "verge" past the genesis block, which so far was impossible with kaustinen-with-shapella.
* To perform a shadow fork of holesky in the special kurtosis setup defined by the devops team.
It is also serving as the basis for multiple other branches, to be merged at a later time:
* The branch to replay historical blocks in verkle
* The branch to execute transition tests
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Guillaume Ballet
f50db1e15a
remove unused code ( #423 )
2024-05-08 13:25:15 +02:00
Guillaume Ballet
1930b97b65
simplified gas accounting layer ( #405 )
...
* simplified gas accounting layer
* integrate some review feedback
* Apply suggestions from code review
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
* more suggestions from code review
* don't charge creation gas + charge code chunks in create
* A couple more fixes
* make linter happy
* fix create init gas consumption issue
* fix: in gas funcs, use tx witness instead of global witness
* fix linter issue
* Apply suggestions from code review
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
* fix: EXTCODECOPY gas consumption
* fix warm gas costs
* fix the order gas is charged in during contract creation epilogue
* fix selfdestruct
* fix #365 in eip rewrite (#407 )
* fix: OOG type in code creation OOG (#408 )
* core/vm: charge BLOCKHASH witness cost (#409 )
* core/vm: charge BLOCKHASH witness cost
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* remove gas optimization for now
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* remove redundant logic for contract creation (#413 )
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* fix precompile address check for charging witness costs & fix missing value-bearing rule (#412 )
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* core/vm: fix wrong check (#416 )
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* charge for account creation if selfdestruct creates a new account (#417 )
* add key comparison test (#418 )
* core/vm: charge contract init before execution logic (#419 )
* core/vm: charge contract init before execution logic
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* fix CREATE2 as well
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
* quell linter
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
0d70489104
core: change block hash history scope ( #411 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
d0ec1be473
Fix TestProcessVerkle* tests ( #410 )
...
* core: fix TestProcessVerkleInvalidContractCreation
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* core: fix TestProcessVerkleContractWithEmptyCode
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* add separate action for testprocessverkle tests
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ng Wei Han
a3232b7cc6
core/txpool/blobpool: fix metrics name for prometheus export ( #27901 ) ( #403 )
...
Co-authored-by: imulmat4 <117636097+imulmat4@users.noreply.github.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
40d5153941
Use circular buffer for BLOCKHASH history ( #402 )
...
* eip2935: use ring buffer
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* limit resolving scope
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
631099322c
Fix TestProcessVerkle tests ( #400 )
...
* move self-destruct witness logic
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* fix test
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
b5495ad1f9
more address truncation fixes ( #399 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
448b405d83
Truncate BALANCE opcode parameter for witness recording
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Guillaume Ballet
c997469bbd
fix: missing MAIN_STORAGE_OFFSET when reading a block hash from the history contract ( #390 )
...
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
f667365a5d
witness: fix contract creation init gas charging ( #393 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
4dc4b398bb
core/vm: fix contract creation witness gas charging logic ( #389 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
c2da1985bc
Fix SELFDESTRUCT incorrect account zeroing & missing beneficiary balance in witness ( #378 )
...
* fix SELFDESTRUCT witness recording
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* add selfdestruct tests
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* solve lint nit
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
f72f7820dd
fix addr alignement ( #366 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
72211cd5d5
Record witness access in BALANCE opcode ( #369 )
...
* record access witness balance in BALANCE opcode
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* add tests for BALANCE opcode
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* add version touching
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* do not touch version
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
8ac057090e
fix integer underflow ( #374 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
077ad8728f
Record witness access in EXTCODEHASH ( #370 )
...
* instructions: add access witness recording for EXTCODEHASH
* add test for EXTCODEHASH witness recording
* add test for access witness EXTCODEHASH
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* do not touch version
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Guillaume Ballet
2e671ea446
eip2935 redesign: insert all 256 ancestors upon transition ( #362 )
...
* eip2935 redesign: only read target block hash
* review fixes
* fix: t8n tool
2024-05-08 13:25:15 +02:00
Guillaume Ballet
61ffef7961
fix: CREATE-time PUSHn adds non-existent entries to witness ( #361 )
...
* fix: CREATE-time PUSHn adds non-existent entries to witness
* this also affects CODECOPY
* fix: add code returned by CREATE* to the witness
* fix gas costs
2024-05-08 13:25:15 +02:00
Guillaume Ballet
7a0eb0b93b
test: check current and new values in state processor witness
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
953338b22b
state: avoid EIP-158 for history storage address ( #359 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Guillaume Ballet
afcfa5af07
Add eip2935 256th ancestor stem to witness ( #355 )
2024-05-08 13:25:15 +02:00
Guillaume Ballet
cc48d57e15
refactor: move trieDB creation outside of block-making loop ( #354 )
2024-05-08 13:25:15 +02:00
Guillaume Ballet
9be95a24f4
another workaround to force verkle at creation
2024-05-08 13:25:15 +02:00
Guillaume Ballet
c3b9b375cc
fix: nil pointer when deactivating verkle-incompatible genesis code ( #353 )
2024-05-08 13:25:15 +02:00
Guillaume Ballet
4c4de3102a
fix: eip2935 block hash storage in chain makers ( #351 )
2024-05-08 13:25:15 +02:00
Guillaume Ballet
c1e0ff10ec
fix: only disable HasLegacyNode call for verkle-at-genesis testnets ( #350 )
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
eb31ae3f9e
accesswitness: touch for origin and to ( #348 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Guillaume Ballet
95d7f39db5
set verkle mode from genesis with override ( #308 )
...
* set verkle mode from genesis with override
* make linter happy
* fix more linter snafu
2024-05-08 13:25:15 +02:00
Guillaume Ballet
ac3f26947d
implement eip 2935 ( #342 )
...
* implement eip 2935
* add touched historical contract slot to the witness
2024-05-08 13:25:15 +02:00
Guillaume Ballet
85a7198c2d
test: check witness when contract creation fails ( #333 )
2024-05-08 13:25:15 +02:00
Guillaume Ballet
8f2ffed7bb
only add the coinbase to the witness if the block reward > 0 ( #332 )
2024-05-08 13:25:15 +02:00
Guillaume Ballet
a5d74825aa
fix: return error if witness costs OOG in instructions ( #319 )
2024-05-08 13:25:15 +02:00
Guillaume Ballet
7757a53d47
force activation of EIP-6780 ( #338 )
...
* force activation of EIP-6780
* rework the PR in a more manageable way
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
f46632148c
accesswitness: avoid charging cost for origin and target ( #334 )
...
* accesswitness: avoid charging cost for origin and target
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* make the linter happy
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
d6477cdc7d
mod: move from gballet/go-verkle to ethereum/go-verkle ( #335 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Ignacio Hagopian
6843ed14e2
vm: fix access witness recording ( #337 )
...
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:15 +02:00
Guillaume Ballet
4815fe2686
remove unused EndVerkleTransition in blockchain.go ( #301 )
2024-05-08 13:25:14 +02:00
Ignacio Hagopian
4f9beb0526
proofs: remove post-values in Multiproof ( #297 )
...
* update proof generation
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* simplification and comment
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* update go-verkle
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2024-05-08 13:25:14 +02:00
Guillaume Ballet
a29f5d60c2
Shanghai time workaround ( #294 )
...
* add workaround to use --override.prague
* fix typo in comments
* fix: enable overrides at genesis time
2024-05-08 13:25:14 +02:00
Guillaume Ballet
0d5126776f
add workaround to use --override.prague ( #292 )
2024-05-08 13:25:14 +02:00
Guillaume Ballet
189a4770dd
fix: incorrect access copy ( #288 )
2024-05-08 13:25:14 +02:00
Guillaume Ballet
990395c688
workaround: disable check for root presence ( #283 )
2024-05-08 13:25:14 +02:00
Guillaume Ballet
5032dd480b
achieving perfection
2024-05-08 13:25:14 +02:00
Guillaume Ballet
1b72c34485
fix more CI complaints
2024-05-08 13:25:14 +02:00
Guillaume Ballet
c94a9dd78b
fix: a couple of CI issues
2024-05-08 13:25:14 +02:00
Guillaume Ballet
2403a275f0
fix linter message
2024-05-08 13:25:14 +02:00
Guillaume Ballet
713db1bbbc
fix: add ProofInBlocks to chain config ( #280 )
2024-05-08 13:25:14 +02:00
Guillaume Ballet
9db5d5c357
port kaustinen code on top of shapella-rebased branch
...
activate proof generation on fork + remove code dups
use go-verkle's post-state API to verify proofs (#262 )
use prague as the verkle activation fork (#263 )
upgrade to latest go-ipa
activate verkle transition in "miner" (#265 )
fix: do not force cancunTime upon verkle activation
workaround: do not use root translation in replay
workaround: deactivate overlay transition for now
fixes from trying to get the devnet to work (#267 )
this line was left out from the previous commit
upgrade to go-verkle with fixed newvalue serialization
fix: ensure point cache isn't nil in copy (#268 )
fix: dependency cycle in tests (#269 )
upgrade to latest go-verkle
fix: write trie preimage data to db (#274 )
fix: zero-root in produced block + sync (#275 )
upgrade go-ipa
fix build
fix typo
include review feedback
add switch to add proofs to blocks (#278 )
add fee recipient to witness (#279 )
touch all fields in withdrawal account header (#277 )
2024-05-08 13:25:14 +02:00