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

feat: upstream op-geth v1.101305.3 ~ v1.101308.2 #86

Merged
merged 254 commits into from
Apr 5, 2024
Merged

Conversation

jyc228
Copy link
Collaborator

@jyc228 jyc228 commented Mar 22, 2024

No description provided.

ajsutton and others added 30 commits October 17, 2023 15:34
…ific block hash (#28084)

* api/bind: Add CallOpts.BlockHash to allow calling contracts at a specific block hash.

* ethclient: Add BalanceAtHash, NonceAtHash and StorageAtHash functions
This change modifies the fuzzers to use the native golang fuzzing framework instead of go-fuzz
…(#28381)

This change to fixes a compilation-flaw on master, by putting architecture-specific functions behind corresponding build tags.
This change fixes a memory leak, when running either state-tests or blockchain-tests, we allocate a `1MB` fastcache during snapshot generation. `fastcache` is a bit special, and requires a `Reset()` (it has it's own memory allocator). 

The `1MB` was hidden [here](https://github.com/ethereum/go-ethereum/blob/master/tests/state_test_util.go#L333) and [here](https://github.com/ethereum/go-ethereum/blob/master/tests/block_test_util.go#L146) respectively.
Changes the trusted_setup to the one created during the kzg-ceremony. The trusted setup file can be found in the consensus specs: https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/trusted_setups/trusted_setup_4096.json
---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
…ds (#28359)

A goroutine is used to manage the lifetime of subscriptions managed by
resubscriptions. When the subscription ends with no error, the resub
goroutine ends as well. However, the resub goroutine needs to live
long enough to read from the unsub channel. Otheriwse, an Unsubscribe
call deadlocks when writing to the unsub channel.

This is fixed by adding a buffer to the unsub channel.
Fixes a bug where the ethstats omits to report full block contents. This bug was a side-effect of ethereum/go-ethereum#26777,  where `CurrentBlock` was changed to return a header instead of a block, leading to a failed type assertion.
…198)

This PR adds more error message for debugging purpose.
…in stacktrie (#28327)

* core, eth, trie: filter out boundary nodes in stacktrie

* eth/protocol/snap: add comments

* Update trie/stacktrie.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth, trie: remove onBoundary callback

* eth/protocols/snap: keep complete boundary nodes

* eth/protocols/snap: skip healing if the storage trie is already complete

* eth, trie: add more metrics

* eth, trie: address comment

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
This change closes ethereum/go-ethereum#27730 . By using an iterator instead of a slice of transactions, we can better handle the case when an individual transaction (within an otherwise well-formed RLP-list) cannot be decoded.
This PR removes panics from stacktrie (mostly), and makes the Update return errors instead. While adding tests for this, I also found that one case of possible corruption was not caught, which is now fixed.
As per discussion in ethereum/execution-apis#475

Signed-off-by: jsvisa <delweng@gmail.com>
…28358)

The String() version of BlockNumberOrHash uses decimal for all block numbers, including negative ones used to indicate labels. Switch to using BlockNumber.String() which encodes it correctly for use in the JSON-RPC API.
This PR is a bit in preparation for the slog work in #28187 .

Our current test re logging mostly test the internals, but we have no real end-to-end test of the logging output. This PR introduces a simple reexec-based log tester. This also relies upon a special mode in geth, which can be made to eject a set of predefined log messages (only available if the build-tag `integrationtests` is used

e.g. go run --tags=integrationtests ./cmd/geth --log.format terminal logtest

While working on this, I also noticed a quirk in the setup: when geth was configured to use a file output, then two separate handlers were used (one handler for the file, one handler for the console). Using two separate handlers means that two formatters are used, thus the formatting of any/all records happened twice. This PR changes the mechanism to use two separate io.Writers instead, which is both more optimal and fixes a bug which occurs due to a global statefulness in the formatter.
Signed-off-by: jsvisa <delweng@gmail.com>
* core, cmd/geth: add --override.* flags to geth init

* also apply overrides before genesis commit with new block

* review feedback
---------

Signed-off-by: jsvisa <delweng@gmail.com>
a little copying is better than a little dependency

-- go proverb

We have this dependency on docker, a.k.a moby: a gigantic library, and we only need ~70 LOC,
so here I tried moving it inline instead.

Co-authored-by: Felix Lange <fjl@twurst.com>
* trie/triedb/pathdb: improve dirty node flushing trigger

* trie/triedb/pathdb: add tests

* trie/triedb/pathdb: address comment
…. (#28379)

This adds warning logs when the read does not match the expected count.
We can also remove the size limit since the function documentation explicitly states
that callers should limit the count.
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.
@jyc228 jyc228 force-pushed the upstream/op-geth branch from 30ff5fe to 6ef0267 Compare March 28, 2024 09:30
core/vm/gen_structlog.go Show resolved Hide resolved
miner/worker.go Show resolved Hide resolved
trie/trienode/node.go Show resolved Hide resolved
core/vm/logger.go Show resolved Hide resolved
FORK.md Outdated Show resolved Hide resolved
jyc228 added 11 commits April 2, 2024 14:31
# Conflicts:
#	.circleci/config.yml
#	cmd/evm/internal/t8ntool/transition.go
#	cmd/geth/chaincmd.go
#	cmd/geth/dbcmd.go
#	cmd/geth/snapshot.go
#	cmd/utils/flags.go
#	core/genesis.go
#	core/genesis_test.go
#	core/rawdb/ancient_utils.go
#	core/state/database.go
#	core/state/statedb.go
#	core/state_transition.go
#	core/types/hashes.go
#	core/vm/gen_structlog.go
#	eth/tracers/api_test.go
#	eth/tracers/logger/logger.go
#	fork.yaml
#	go.sum
#	internal/ethapi/api.go
#	internal/flags/categories.go
#	les/api_backend.go
#	les/client.go
#	les/handler_test.go
#	les/odr_requests.go
#	les/odr_test.go
#	les/server.go
#	les/state_accessor.go
#	light/odr_test.go
#	light/trie.go
#	light/trie_test.go
#	light/txpool.go
#	params/superchain.go
#	trie/database.go
#	trie/iterator_test.go
#	trie/sync.go
#	trie/sync_test.go
# Conflicts:
#	.circleci/config.yml
#	core/genesis.go
#	fork.yaml
#	params/superchain.go
@jyc228 jyc228 force-pushed the upstream/op-geth branch from b88c3b5 to f401b97 Compare April 2, 2024 05:41
core/types/receipt_test.go Outdated Show resolved Hide resolved
core/types/rollup_cost_test.go Outdated Show resolved Hide resolved
seolaoh
seolaoh previously approved these changes Apr 4, 2024
Copy link
Contributor

@seolaoh seolaoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# Conflicts:
#	cmd/geth/main.go
#	core/state/database.go
#	miner/payload_building.go
@jyc228 jyc228 force-pushed the upstream/op-geth branch from 13b5f57 to bf1c821 Compare April 4, 2024 08:14
@seolaoh seolaoh dismissed their stale review April 4, 2024 09:00

found necessary changes

Copy link
Contributor

@seolaoh seolaoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jyc228 jyc228 merged commit 56bd00a into dev Apr 5, 2024
4 checks passed
@jyc228 jyc228 deleted the upstream/op-geth branch April 5, 2024 07:45
@kangsorang kangsorang restored the upstream/op-geth branch April 8, 2024 11:09
@seolaoh seolaoh deleted the upstream/op-geth branch April 30, 2024 05:20
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.