Commit graph

2349 commits

Author SHA1 Message Date
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
Guillaume Ballet
b7648a503e quell zero-tree message 2024-05-08 13:25:14 +02:00
Guillaume Ballet
b4c3b59a85 add pre-pbss rebase branches to CI (#270)
* add post-pbss rebase branches to CI

* fix go version in CI

* fix linter issues

* upgrade go version to 1.21.1 to avoid github deploy error
2024-05-08 13:25:14 +02:00
Guillaume Ballet
9eee5a360b core: move overlay conversion code to its own file (#266) 2024-05-08 13:25:14 +02:00
Ignacio Hagopian
ed36c23480 core/state: rewrite a new optimized keyValueMigrator (#256)
* trie/utils: add helper to calculate code tree indices

* core/state: rewrite optimized version of keyValueMigrator

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>

* trie/verkle: remove uint256 allocs (#257)

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
f090ddbe9d remove unused map param in MakeVerkleMultiProof (#261) 2024-05-08 13:25:14 +02:00
Ignacio Hagopian
a0e1995bc4 New access-witness module (#235)
Use plain addresses/slot numbers instead of hashing them in the witness
2024-05-08 13:25:14 +02:00
Guillaume Ballet
9bb7f41c2d code cleanup: remove a lot of TODOs & friends 2024-05-08 13:25:14 +02:00