This pull request introduces a state.Reader interface for state
accessing.
The interface could be implemented in various ways. It can be pure trie
only reader, or the combination of trie and state snapshot. What's more,
this interface allows us to have more flexibility in the future, e.g.
the
archive reader (for accessing archive state).
Additionally, this pull request removes the following metrics
- `chain/snapshot/account/reads`
- `chain/snapshot/storage/reads`
This PR adds the bulk verkle witness+proof production at the end of block
production. It reads all data from the tree in one swoop and produces
a verkle proof.
Co-authored-by: Felix Lange <fjl@twurst.com>
This change makes use of uin256 to represent balance in state. It touches primarily upon statedb, stateobject and state processing, trying to avoid changes in transaction pools, core types, rpc and tracers.
This change improves GenerateChain to support internal chain history access (ChainReader)
for the consensus engine and EVM.
GenerateChain takes a `parent` block and the number of blocks to create. With my changes,
the consensus engine and EVM can now access blocks from `parent` up to the block currently
being generated. This is required to make the BLOCKHASH instruction work, and also needed
to create real clique chains. Clique uses chain history to figure out if the current signer is in-turn,
for example.
I've also added some more accessors to BlockGen. These are helpful when creating transactions:
- g.Signer returns a signer instance for the current block
- g.Difficulty returns the current block difficulty
- g.Gas returns the remaining gas amount
Another fix in this commit concerns the receipts returned by GenerateChain. The receipts now
have properly derived fields (BlockHash, etc.) and should generally match what would be
returned by the RPC API.
This PR makes EIP-4788 work in the engine API and miner. It also fixes some bugs related to
EIP-4844 block processing and mining. Changes in detail:
- Header.BeaconRoot has been renamed to ParentBeaconRoot.
- The engine API now implements forkchoiceUpdatedV3
- newPayloadV3 method has been updated with the parentBeaconBlockRoot parameter
- beacon root is now applied to new blocks in miner
- For EIP-4844, block creation now updates the blobGasUsed field of the header
This fixes an issue where the withdrawal index was not calculated correctly
for multiple withdrawals in a single block.
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
This change ports some changes from the main PBSS PR:
- get rid of callback function in `trie.Database.Commit` which is not required anymore
- rework the `nodeResolver` in `trie.Iterator` to make it compatible with multiple state scheme
- some other shallow changes in tests and typo-fixes
This change implements withdrawals as specified in EIP-4895.
Co-authored-by: lightclient@protonmail.com <lightclient@protonmail.com>
Co-authored-by: marioevz <marioevz@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
This PR builds on #26299, but also updates the tests to the most recent version, which includes tests regarding TheMerge.
This change adds checks to the beacon consensus engine, making it more strict in validating the pre- and post-headers, and not relying on the caller to have already correctly sanitized the headers/blocks.
This PR introduces a node scheme abstraction. The interface is only implemented by `hashScheme` at the moment, but will be extended by `pathScheme` very soon.
Apart from that, a few changes are also included which is worth mentioning:
- port the changes in the stacktrie, tracking the path prefix of nodes during commit
- use ethdb.Database for constructing trie.Database. This is not necessary right now, but it is required for path-based used to open reverse diff freezer
This PR changes geth to read the eip1559 params from the chain config instead of the globals.
This way the parameters may be changed by forking the chain config code, without creating a large diff throughout the past and future usages of the parameters.
Co-authored-by: Martin Holst Swende <martin@swende.se>
* base setup for miner opentel
* version change
* modify ctx passing
* add attributes
* update fill txs span attributes
* fix: use common attributes for remote and local txs
* pass context in seal
* fix
* fix
* add traces to finalize and assemble
* fix
* use task ctx in result loop
* only start parent span if no error
* send nil tracer from Finalize
* clean up
* add sub function timings in span attribute
* modify span attributes
* set time attribute to milliseconds
* linters fix
* fix linters for consensus
* add nolint to worker
* fix testcase
* Added fillTransactions subTraces
* add traces in intermediate root hash function
* add traces in WriteBlockAndSetHead function, fix linters
* fix: linting errors
* fix: test cases
* fix: go.mod
* fix: testcase
* extract tracing package
* linters fix
* debug
* Revert "debug"
This reverts commit 2d68b7c7b1105080563a4e1a6949dabc10acaff8.
* fix: panic in NewTransactionsByPriceAndNonce iteration
* change heimdall version to develop
* miner/worker: fix duplicate call to tx ordering
* miner/worker: refactor tracing
* consensus/bor: use tracing package
* tracing: add more abstraction for spans
* tracing: set all attributes at once
* remove nested tracing from blockchain.WriteBlockAndSetHead function
* remove nested tracing from statedb.IntermediateRoot function
* handle end span in bor.Seal function
* fix: typo
* minor fixes
* fix: linters
* fix: remove nolint
* go mod tidy
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
Co-authored-by: Evgeny Danienko <6655321@bk.ru>
* Limit state sync by gas
* Added logging for state-sync total gas usage
* Added number of event-records in log
* Minor Changes
* Minor Fix
* Adding individual gasUsed
* Minor Fix
* it works
* fix tests
* log wiggle and delay with block number
* log delays as numbers
* linters
* fix tests
* restore linters for the project
* fix linters
* fix
* fix
* fix
* linters
* generation
* fix tests
* remove heimdall wrapper response
* linters
* remove possible collisions
* remove possible collisions
* remove possible collisions
* tests for unique address generation
* generalize set
* bor miner tests got restored
* fixes after CR
* final step and mining test
* fix
* fix e2e
* more tests for Heimdall requests
* fix linters
Co-authored-by: Ferran <ferranbt@protonmail.com>
Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
* merge geth v1.10.15
* fix: Removed FastSync from cli server
* fix: TestHeadersRLPStorage
* Added t.skip(ETH2 in bor)
* fix: flow in create consensus engine
* bumped version
* Fix typo
* increase block time
* remove file
* bumped version
* merge gethv1.10.17
* bumped version
* fix failing tests
* Bump Go version to v1.18 (#368)
* Bump Go version to v1.18.1
* Build using netgo tag
This will create a static build using Go native networking stack.
Checked and it works stable for all archs and distros.
* Fix meta
* Bump version
* Meta as stable
Co-authored-by: Shivam Sharma <shivam691999@gmail.com>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
Co-authored-by: Sandeep Sreenath <sandeep.sreenath@gmail.com>
Co-authored-by: Victor Castell <victor@victorcastell.com>