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>
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)
Squash the main verkle PR ahead of rebase
don't call Bytes() in GetTreeKey (#137)
trie: avoid endianness conversion in GetTreeKey (#140)
* trie/utils: add concrete expected value in trie key generation test
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* mod: update to latest go-verkle
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* trie/utils: avoid endianness conversions
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* apply review changes & update to official go-verkle version
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
upgrade go-verkle to CoW version and get TestProcessVerkle to build (#138)
updating ci to use self-hosted machine (#143)
fix: storage offset in non-header group + reuse of value buffer (#145)
dedup call to ChunkifyCode, same as replay branch (#156)
* dedup call to ChunkifyCode, same as replay branch
* fix some linter issues
fix code offset in tree update (#157)
fix REVERT in state processor test execution (#158)
* fix code offset in tree update
* fix REVERT in test execution
save on key hashing: lump code size update with first code chunk group (#159)
fix code chunk key calculation and storage key calculation (#161)
* fix codeKey calculation
* Remove
* fix storageOffset
* fix the fix to the fix to the offset fix
* Remove copy/pasted, unused code in test
* fix linter
---------
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
fix: infinite loop when calling extcodecopy on empty code (#151)
upgrade to latest go-verkle
fix: only update code in the tree if it's dirty (#174)
fix: read-touch the code size and Keccak of the origin (#175)
List of changes for converting a sepolia database (#182)
* naive conversion rebased on top of beverly hills
* changes for the sepolia shadow fork conversion
* fixes to please the linter
* fixes to please the linter
Unified point cache (#180)
* Unified point cache
* Use cache for Try*Account
* alter Trie interface to use caching for slots (#181)
* alter Trie interface to use caching for slots
* fix: use a lock to protect the point cache (#185)
* use fastest non-master go-verkle version & pull trie/Verkle.go changes to use new api (#184)
* mod: update to fastest go-verkle version today
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* trie/verkle: use new batch serialization api
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
* fix: TryDelete signature in unit tests
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
trie/utils: fix potential overflow (#191)
* trie/utils: fix potential overflow
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* trie/utils: receive storage key as a byte slice
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* revert formatter changes
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* trie/utils: fix mod 256
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
trie/utils: fix incorrect bigint assignment (#193)
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
upgrade precomp link to fix CI
fix: add missing code size&keccak leaves in empty accounts (#192)
fixes to use the latest go-verkle@master (#197)
* fixes to use the latest go-verkle@master
* linter fixes
* linter fixes for tests
* fix: use jsign's go-verkle fix
refactor: remove unused (*StateDB).GetXLittleEndian methods (#204)
fix gas accounting issue in state_processor_test.go (#207)
update go-verkle not to use StatelessNode anymore (#206)
* update go-verkle not to use StatelessNode anymore
* update go-verkle to latest
refactor: move verkle gas accounting to its own block in TransitionDB (#208)
fix a panic in deserializeVerkleProof if GetProofItems returns a nil ProofElements
use the cachingDB instead of a custom VerkleDB (#209)
* use the cachingDB instead of a custom VerkleDB
* fix stack trace in LES
remove holiman from CODEOWNERS as he gets too many emails
read from tree in state object if the snapshot is nil (#205)
add missing error checks for the root node type (#214)
implement OpenStorageTrie for verkle trees (#210)
* implement OpenStorageTrie for verkle trees
* add a few comments for future maintenance
* fix linter issue
fix: copy balance leaf to new buffer in TryGetAccount (#217)
implement some heretofore unimplemented iterator methods (#219)
params: move verkle params to their own file (#228)
fix: proper number of chunk evals (#215)
overlay transition (#244)
* overlay transition
Fix some bugs identified in the code review
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
Include base -> overlay key-values migration logic (#199)
* mod: add go-verkle version with key-value migration new apis
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* core/stateprocessor: use constant for max number of migrated key-values
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* core: add base->overlay key-values migration logic
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* core: fix some compiler errors
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* trie: consider removing transition trie api in the future
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* mod: use latest go-verkle
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
fix some unit tests errors
get convresion block from file
fix compilation issues
fix initialization issue in migrator
fix: changes needed to run the first 28 blocks
important sutff: fix the banner
fix: use nonce instead of balance in nonce leaf (#202)
fixes for performing the overlay transition (#203)
* fixes for performing the overlay transition
* fixes for the full replay
* fix: deletion-and-recreation of EoA
* fixes to replay 2M+ blocks
* upgrade to go-verkle@master
* fix: proper number of chunk evals
* rewrite conversion loop to fix known issues
changes to make replay work with the overlay method (#216)
* fixes for performing the overlay transition
fixes for the full replay
fix: deletion-and-recreation of EoA
fixes to replay 2M+ blocks
upgrade to go-verkle@master
fix: proper number of chunk evals
rewrite conversion loop to fix known issues
changes to make replay work with the overlay method
fixes to replay 2M+ blocks
update to latest go-verkle@master
* use a PBSS-like scheme for internal nodes (#221)
* use a PBSS-like scheme for internal nodes
* a couple of fixes coming from debugging replay
* fix: use an error to notify the transition tree that a deleted account was found in the overlay tree (#222)
* fixes for pbss replay (#227)
* fixes for pbss replay
* trie/verkle: use capped batch size (#229)
* trie/verkle: use capped batch size
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* trie/verkle: avoid path variable allocation per db.Put
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* don't keep more than 32 state root conversions in RAM (#230)
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
* cleanup some code
* mod: update go-verkle
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* re-enable snapshot (#231)
* re-enable cancun block / snapshot (#226)
* clear storage conversion key upon translating account (#234)
* clear storage conversion key upon translating account
* mod: use latest go-verkle
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
* fix: self-deadlock with translated root map mutex (#236)
* return compressed commitment as root commitment (#237)
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
fix first panic in *TransitionTrie.Copy()
upgrade go-verkle to latest master
mod: update go-verkle (#239)
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
core: print state root every 100 blocks (#240)
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
fix: only Commit the account trie (#242)
fixes to get TestProcessVerkle to work with the overlay branch (#238)
* fixes to get TestProcessVerkle to work with the overlay branch
* fix all panics in verkle state processor test
* fix proof verification
move transition management to cachingDB
* fix: mark the verkle transition as started if it's ended without being started
* fix the verkle state processing test
* fix linter errors
* Add a function to clear verkle params for replay
* fix: handle TransitionTrie in OpenStorageTrie
* fix linter issue
* fix the deleted account error (#247)
* code cleanup (#248)
* fix: don't error on a missing conversion.txt (#249)
* Overlay Tree preimages exporting and usage (#246)
* export overlay preimages tool
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* use preimages flat file in overlay tree migration logic
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* cmd/geth: add --roothash to overlay tree preimage exporting command
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* cleanup
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* review feedback
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
* fix: reduce the PR footprint (#250)
* fix: don't fail when preimages.bin is missing (#251)
* fix: don't fail when preimages.bin is missing
* fix: don't open the preimages file when outside of transition
---------
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
Co-authored-by: Ignacio Hagopian <jsign.uy@gmail.com>
review changes
remove replay-specific code
* core/blobpool: implement txpool for blob txs
* core/txpool: track address reservations to notice any weird bugs
* core/txpool/blobpool: add support for in-memory operation for tests
* core/txpool/blobpool: fix heap updating after SetGasTip if account is evicted
* core/txpool/blobpool: fix eviction order if cheap leading txs are included
* core/txpool/blobpool: add note as to why the eviction fields are not inited in reinject
* go.mod: pull in inmem billy form upstream
* core/txpool/blobpool: fix review commens
* core/txpool/blobpool: make heap and heap test deterministic
* core/txpool/blobpool: luv u linter
* core/txpool: limit blob transactions to 16 per account
* core/txpool/blobpool: fix rebase errors
* core/txpool/blobpool: luv you linter
* go.mod: revert some strange crypto package dep updates
This is a spin-out from the EIP-4844 devnet branch, containing just the Engine API modifications
and nothing else. The newPayloadV3 endpoint won't really work in this version, but we need the
data structures for testing so I'd like to get this in early.
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This change removes PoW header syncing related code from LES and also deletes
duplicated packages les/catalyst, les/downloader and les/fetcher. These package copies
were created because people wanted to make changes in their eth/ counterparts, but weren't
able to adapt LES code to the API changes.
The struct logger (or opcode tracer) was missing the return data field even
if this was explicitly enabled by user via `"enableReturnData": true` in the config.
This PR fixes this issue.
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
This change makes the StateDB track the state key value diff of a block transition.
We already tracked current account and storage values for the purpose of updating
the state snapshot. With this PR, we now also track the original (pre-transition) values
of accounts and storage slots.
This change adds back the 'geth --dev' mode of operation, using a cl-mocker.
---------
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
The clean trie cache is persisted periodically, therefore Geth can
quickly warmup the cache in next restart.
However it will reduce the robustness of system. The assumption is
held in Geth that if the parent trie node is present, then the entire
sub-trie associated with the parent are all prensent.
Imagine the scenario that Geth rewinds itself to a past block and
restart, but Geth finds the root node of "future state" in clean
cache then regard this state is present in disk, while is not in fact.
Another example is offline pruning tool. Whenever an offline pruning
is performed, the clean cache file has to be removed to aviod hitting
the root node of "deleted states" in clean cache.
All in all, compare with the minor performance gain, system robustness
is something we care more.
The state availability is checked during the creation of a state reader.
- In hash-based database, if the specified root node does not exist on disk disk, then
the state reader won't be created and an error will be returned.
- In path-based database, if the specified state layer is not available, then the
state reader won't be created and an error will be returned.
This change also contains a stricter semantics regarding the `Commit` operation: once it has been performed, the trie is no longer usable, and certain operations will return an error.
This removes the feature where top nodes of the proof can be elided.
It was intended to be used by the LES server, to save bandwidth
when the client had already fetched parts of the state and only needed
some extra nodes to complete the proof. Alas, it never got implemented
in the client.
* all: move main transaction pool into a subpool
* go.mod: remove superfluous updates
* core/txpool: review fixes, handle txs rejected by all subpools
* core/txpool: typos
We had to do this workaround because it wasn't possible to export typed arrays from
JS to []byte. This was added in dop251/goja@2352993, so we can use the better way now.
* core/txpool: abstraction prep work for secondary pools (blob pool)
* core/txpool: leave subpool concepts to a followup pr
* les: fix tests using hard coded errors
* core/txpool: use bitmaps instead of maps for tx type filtering
Drop the notions of uncles, and disables activities while syncing
- Disable activities (e.g. generate pending state) while node is syncing,
- Disable empty block submission (but empty block is still kept for payload building),
- Drop uncle notion since (ethash is already deprecated)
eth: make StorageRangeAt take a block hash or number
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
This change implements async log retrievals via feeding logs in channels, instead of returning slices. This is a first step to implement #15063.
---------
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
ethclient accepts certain negative block number values as specifiers for the "pending",
"safe" and "finalized" block. In case of "pending", the value accepted by ethclient (-1)
did not match rpc.PendingBlockNumber (-2).
This wasn't really a problem, but other values accepted by ethclient did match the
definitions in package rpc, and it's weird to have this one special case where they don't.
To fix it, we decided to change the values of the constants rather than changing ethclient.
The constant values are not otherwise significant. This is a breaking API change, but we
believe not a dangerous one.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>