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: merge with upstream v1.5.5 #69

Draft
wants to merge 922 commits into
base: develop
Choose a base branch
from
Draft

feat: merge with upstream v1.5.5 #69

wants to merge 922 commits into from

Conversation

irrun
Copy link
Collaborator

@irrun irrun commented Feb 8, 2025

Description

add a description of your changes here...

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

naveen-imtb and others added 30 commits November 8, 2024 15:04
This change updates the EIP-712 implementation to resolve [#30619](ethereum/go-ethereum#30619).

The test cases have been repurposed from the ethers.js [repository](https://github.com/ethers-io/ethers.js/blob/main/testcases/typed-data.json.gz), but have been updated to remove tests that don't have a valid domain separator; EIP-712 messages without a domain separator are not supported by geth.

---------

Co-authored-by: Martin Holst Swende <[email protected]>
… and fork (#30442)

When `evm statetest --bench` is specified, benchmark the execution
similarly to `evm run`.

Also adds the ability to filter tests by name, index and fork. 

---------

Co-authored-by: Martin Holst Swende <[email protected]>
This PR moves chain config related code (config file processing, fork
logic, network defaults) from `beacon/types` and `beacon/blsync` into
`beacon/params` while the command line flag logic of the chain config is
moved into `cmd/utils`, thereby removing the cli dependencies from
package `beacon` and its sub-packages.
This change invokes the OnCodeChange hook when selfdestruct operation is performed, and a contract is removed. This is an event which can be consumed by tracers.
Adds a protocol handler fuzzer to fuzz the ETH68 protocol handlers
add unit tests for `p2p/addrutil`

---------

Co-authored-by: Martin HS <[email protected]>
fixes a typo on one of the postmortems
Fixes an error in the binary iterator, adds additional testcases

---------

Co-authored-by: Gary Rong <[email protected]>
This is one further step towards removing account management from
`geth`. This PR deprecates the flag `unlock`, and makes the flag moot:
unlock via geth is no longer possible.
The [kilic](https://github.com/kilic/bls12-381) bls12381 implementation
has been archived. It shouldn't be necessary to include it as a fuzzing
target any longer.

This also adds fuzzers for G1/G2 mul that use inputs that are guaranteed
to be valid. Previously, we just did random input fuzzing for these
precompiles.
This adds an API method `DropTransactions` to legacy pool, blob pool and
txpool interface. This method removes all txs currently tracked in the
pools.

It modifies the simulated beacon to use the new method in `Rollback`
which removes previous hacky implementation that also erroneously reset
the gas tip to 1 gwei.

---------

Co-authored-by: Felix Lange <[email protected]>
In many cases, there is a need to create somewhat nontrivial bytecode. A
recent example is the verkle statetests, where we want a `CREATE2`- op
to create a contract, which can then be invoked, and when invoked does a
selfdestruct-to-self.

It is overkill to go full solidity, but it is also a bit tricky do
assemble this by concatenating bytes. This PR takes an approach that
has been used in in goevmlab for several years.

Using this utility, the case can be expressed as: 
```golang
	// Some runtime code
	runtime := program.New().Ops(vm.ADDRESS, vm.SELFDESTRUCT).Bytecode()
	// A constructor returning the runtime code
	initcode := program.New().ReturnData(runtime).Bytecode()
	// A factory invoking the constructor
	outer := program.New().Create2AndCall(initcode, nil).Bytecode()
```

We have a lot of places in the codebase where we concatenate bytes, cast
from `vm.OpCode` . By taking tihs approach instead, thos places can be made a
bit more maintainable/robust.
This pull request refactors the EVM constructor by removing the
TxContext parameter.

The EVM object is frequently overused. Ideally, only a single EVM
instance should be created and reused throughout the entire state
transition of a block, with the transaction context switched as needed
by calling evm.SetTxContext.

Unfortunately, in some parts of the code, the EVM object is repeatedly
created, resulting in unnecessary complexity. This pull request is the
first step towards gradually improving and simplifying this setup.

---------

Co-authored-by: Martin Holst Swende <[email protected]>
* fix compile for statedb_test.go

* format addresses of core/vm/contracts

* fix compilation of package simulated

* tests: update tests

* remove rootParent in triePrefetcher

* add ClearAccessList for processing system txs before Cancun

* copy prefetcher when copy statedb

* always prefetch the account trie once the prefetcher is constructed

* recover TriePrefetchInAdvance

* fix comment for s.StopPrefetcher

* fix noTrie in statedb.go

* improve SnapToDiffLayer

* fix test cases in core/state

* fix compilation of test cases in core

* fix compilation of test cases in cmd, internal and trie

* remove Requests in BlockBody

* define RequestsHash in parlia engine

* fix compilation of test cases in eth

* fix compilation of test cases in ethclient and miner

* fix compilation of test cases in triedb/pathdb

* add todo for relation between witness and noTrie

* fix Nancy CI

* fix golangci-lint part I

* update golang to 1.23.x from 1.21.x in workflows

* remove sepoliaAllocData and holeskyAllocData

* modifiy interface FinalizeAndAssemble

* fix golangci-lint part II

* fix golangci-lint part III

* fix golangci-lint done

* check for multidb

* improve interface EnableBlockValidator

* fix getGenesisState

* code review for core/rawdb

* fix mustCopyTrie

* fix state_processor

* adapt for changes in func NewBlock

* improve EncodeSigHeader

* fix test cases in dir core, part I

* fix TestParliaBlobFeeReward

* fix repairHistory

* remove diskdb in triedb.Database

* fix asyncnodebuffer

* adapt memory freezer for blob table

* comment verkle related test cases

* fix golang lint

* use 1.21.x to run golangci-lint

* fix TestBsc1Messages

* fix TestSnapSyncWithBlobs

* fix traceTx

* update golang version for docker

* improve newWorker

* fix: truncate state history ut

* TestTailTruncateHistory clear up

* fix test cases in dir tests

* remove deprecated flags in truffle test

* comment filterNode

* HeaderChain.GenesisHeader

* fix golangcilint

* fix truffle-test CI

* update .nancy-ignore to avoid conflicts with develop branch

* update diff go-ethereum patch

* remove isTTDReached in worker

* fix mockparlia FinalizeAndAssemble

* fix golangci-lint

* fix makeEnv

* change log level for tri prefetch

---------

Co-authored-by: joeylichang <[email protected]>
Co-authored-by: joey <[email protected]>
Follow-up to #30745 , this change removes some unnecessary parameters.
holiman and others added 29 commits February 4, 2025 17:23
Replaces  #29297, descendant from #27535

---------

This PR removes `locals` as a concept from transaction pools. Therefore,
the pool now acts as very a good simulation/approximation of how our
peers' pools behave. What this PR does instead, is implement a
locals-tracker, which basically is a little thing which, from time to
time, asks the pool "did you forget this transaction?". If it did, the
tracker resubmits it.

If the txpool _had_ forgotten it, chances are that the peers had also
forgotten it. It will be propagated again.

Doing this change means that we can simplify the pool internals, quite a
lot.

### The semantics of `local` 

Historically, there has been two features, or usecases, that has been
combined into the concept of `locals`.

1. "I want my local node to remember this transaction indefinitely, and
resubmit to the network occasionally"
2. "I want this (valid) transaction included to be top-prio for my
miner"


This PR splits these features up, let's call it `1: local` and `2:
prio`. The `prio` is not actually individual transaction, but rather a
set of `address`es to prioritize.
The attribute `local` means it will be tracked, and `prio` means it will
be prioritized by miner.

For `local`: anything transaction received via the RPC is marked as
`local`, and tracked by the tracker.
For `prio`: any transactions from this sender is included first, when
building a block. The existing commandline-flag `--txpool.locals` sets
the set of `prio` addresses.

---------

Co-authored-by: Gary Rong <[email protected]>
A clarification was made to EIP-7691 stating that at the fork boundary
it is required to use the target blob count associated with the head
block, rather than the parent as implemented here.

See for more: ethereum/EIPs#9249
This PR changes the signature of `CalcExcessBlobGas` to take in just
the header timestamp instead of the whole object. It also adds a sanity
check for the parent->child block order to `VerifyEIP4844Header`.
Here we add some more changes for live tracing API v1.1:

- Hook `OnSystemCallStartV2` was introduced with `VMContext` as parameter.
- Hook `OnBlockHashRead` was introduced.
- `GetCodeHash` was added to the state interface
- The new `WrapWithJournal` construction helps with tracking EVM reverts in the tracer.

---------

Co-authored-by: Felix Lange <[email protected]>
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.