Commit Graph

15683 Commits

Author SHA1 Message Date
Jared Wasinger 26641a190a make tests run again 2025-01-22 13:54:57 +01:00
Jared Wasinger afe887fcc3 remove old half-written test case with events (I will add it back in when I complete it). 2025-01-22 13:54:57 +01:00
Jared Wasinger b612cab7f1 simplify generated code for list of library dependencies 2025-01-22 13:54:57 +01:00
Jared Wasinger 0bdf69cbc6 some more docs 2025-01-22 13:54:57 +01:00
Jared Wasinger 0cff488b04 fix v2 test 2025-01-22 13:54:57 +01:00
Jared Wasinger ab97d38da5 more docs. fix nested library contract. fix associated test case. 2025-01-22 13:54:57 +01:00
Jared Wasinger b2aec5af41 add missing files from testdata. refactor contract deployment API to be cleaner 2025-01-22 13:54:57 +01:00
Jared Wasinger 03a6ade16b format improvements 2025-01-22 13:54:57 +01:00
Jared Wasinger 41b77f9d9c update library test contract to have constructor with inputs. remove some debug print statements 2025-01-22 13:54:57 +01:00
Jared Wasinger 42d159fb9a fix contract 2025-01-22 13:54:57 +01:00
Jared Wasinger 7c95aa1411 closer to test passing now... 2025-01-22 13:54:57 +01:00
Jared Wasinger 5ba939f50c rework contract deployment API 2025-01-22 13:54:57 +01:00
Jared Wasinger cc04aa4e9e commit of wip-code: rework the contract deployment code to be cleaner 2025-01-22 13:54:57 +01:00
Jared Wasinger 6d9104e706 dependency graph calculation working 2025-01-22 13:54:57 +01:00
Jared Wasinger 26491ae5cd still in a wip state 2025-01-22 13:54:57 +01:00
Jared Wasinger 61263dcd68 stage point before I try to dedup contract interaction api 2025-01-22 13:54:57 +01:00
Jared Wasinger 0aac1981f5 move v2 contract interaction methods into v2 package. add test 2025-01-22 13:54:57 +01:00
Jared Wasinger 9c086811ae isolate V2 contract interaction API into its own package 2025-01-22 13:54:57 +01:00
Jared Wasinger cb0d1ea3ba fix last rebase regression 2025-01-22 13:54:56 +01:00
Jared Wasinger f7fa3fe037 add back code that got mistakenly removed in the rebase 2025-01-22 13:54:56 +01:00
Sina Mahmoodi 135ef69b9b fix test 2025-01-22 13:54:56 +01:00
Sina Mahmoodi c14bd3d6e7 clean lang selection leftovers 2025-01-22 13:54:55 +01:00
Sina Mahmoodi b504552373 Pass pointer to log for unpack 2025-01-22 13:53:59 +01:00
Sina Mahmoodi f7084f4723 Add deploy code to contract struct 2025-01-22 13:53:59 +01:00
Sina Mahmoodi e2746e7f54 define contract instance type 2025-01-22 13:53:59 +01:00
Sina Mahmoodi 040f808742 skip unpack method when no return args 2025-01-22 13:53:59 +01:00
Sina Mahmoodi ee1263a78c drop fmt 2025-01-22 13:53:59 +01:00
Sina Mahmoodi 7b6f0eadd7 replace fmt with errors
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2025-01-22 13:53:59 +01:00
Sina Mahmoodi 6b69f4c90c drop unnecessary imports 2025-01-22 13:53:59 +01:00
Sina Mahmoodi d4ccdc30c2 add copyright header to lib.go 2025-01-22 13:53:59 +01:00
Sina Mahmoodi ed627ccf8b accounts/abi: abigen v2 2025-01-22 13:53:59 +01:00
Felix Lange 4af9af419d
go.mod: remove toolchain line (#31057)
We have our own system for downloading the toolchain, and really don't
want Go's to get in the way of that. We may switch to Go's builtin
toolchain support, but not now.
2025-01-21 22:23:46 +01:00
jwasinger 6c10996bf5
eth/filters: ensure API timeoutLoop terminates with event system (#31056)
Discovered from failing test introduced
https://github.com/ethereum/go-ethereum/pull/31033 . We should ensure
`timeoutLoop` terminates if the filter event system is terminated.
2025-01-21 13:11:05 +01:00
Martin HS 2bf4a8ff73
cmd/evm: refactor handling output-files for `t8n` (#30854)
As part of trying to make the inputs and outputs of the evm subcommands
more streamlined and aligned, this PR modifies how `evm t8n` manages
output-files.

Previously, we do a kind of wonky thing where between each transaction,
we invoke a `getTracer` closure. In that closure, we create a new
output-file, a tracer, and then make the tracer stream output to the
file. We also fiddle a bit to ensure that the file becomes properly
closed.

It is a kind of hacky solution we have in place. This PR changes it, so
that from the execution-pipeline point of view, we have just a regular
tracer. No fiddling with re-setting it or closing files.

That particular tracer, however, is a bit special: it takes care of
creating new files per transaction (in the tx-start-hook) and closing
(on tx-end-hook). Also instantiating the right type of underlying
tracer, which can be a json-logger or a custom tracer.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-01-21 15:35:03 +08:00
jwasinger e25cedf16d
core/txpool: terminate subpool reset goroutine if pool was closed (#31030)
if the pool terminates before `resetDone` can be read, then the
go-routine will hang.
2025-01-21 11:42:05 +08:00
Shude Li 530adfc8e3
core/types: initialize ChainID in SetCodeTx copy method (#31054) 2025-01-20 17:06:39 +01:00
levisyin 448e16ad54
build: upgrade -dlgo version to Go 1.23.5 (#31037) 2025-01-20 17:04:29 +01:00
Shude Li 17199daa76
core/types: correct chainId check for pragueSigner (#31032)
Use zero value check for the pragueSigner

This aligns with cancunSigner and londonSigner as well.
2025-01-20 10:12:36 +01:00
Cedrick cc814d6b7b
cmd/abigen: require either `--abi` or `--combined-json` (#31045)
This PR addresses issue #30768 , which highlights that running
cmd/abigen/abigen --pkg my_package example.json (erroneously omitting
the --abi flag) generates an empty binding, when it should fail
explicitly.

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
2025-01-20 08:39:55 +01:00
Felföldi Zsolt ea31bd9faf
ethdb/memorydb: faster DeleteRange (#31038)
This PR replaces the iterator based DeleteRange implementation of
memorydb with a simpler and much faster loop that directly deletes keys
in the order of iteration instead of unnecessarily collecting keys in
memory and sorting them.

---------

Co-authored-by: Martin HS <martin@swende.se>
2025-01-17 16:54:19 +01:00
rjl493456442 a7f9523ae1
all: implement state history v2 (#30107)
This pull request delivers the new version of the state history, where
the raw storage key is used instead of the hash.

Before the cancun fork, it's supported by protocol to destruct a
specific account and therefore, all the storage slot owned by it should
be wiped in the same transition.

Technically, storage wiping should be performed through storage
iteration, and only the storage key hash will be available for traversal
if the state snapshot is not available. Therefore, the storage key hash
is chosen as the identifier in the old version state history.

Fortunately, account self-destruction has been deprecated by the
protocol since the Cancun fork, and there are no empty accounts eligible
for deletion under EIP-158. Therefore, we can conclude that no storage
wiping should occur after the Cancun fork. In this case, it makes no
sense to keep using hash.

Besides, another big reason for making this change is the current format
state history is unusable if verkle is activated. Verkle tree has a
different key derivation scheme (merkle uses keccak256), the preimage of
key hash must be provided in order to make verkle rollback functional.
This pull request is a prerequisite for landing verkle.

Additionally, the raw storage key is more human-friendly for those who
want to manually check the history, even though Solidity already
performs some hashing to derive the storage location.

---

This pull request doesn't bump the database version, as I believe the
database should still be compatible if users degrade from the new geth
version to old one, the only side effect is the persistent new version
state history will be unusable.

---------

Co-authored-by: Zsolt Felfoldi <zsfelfoldi@gmail.com>
2025-01-17 02:59:02 +01:00
Matthieu Vachon 4d94bd83b2
core/tracing: document `OnCodeChange` now being called from SelfDestruct (#31007)
Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
2025-01-16 15:58:16 +01:00
jwasinger 47d17acdc9
core/txpool/legacypool: ensure pending nonces are reset by SubPool.Clear (#31020)
closes https://github.com/ethereum/go-ethereum/issues/30842
2025-01-16 14:40:15 +01:00
georgehao 9e4f08c25d
core: use sync.Once for SenderCacher initialization (#31029)
This changes the SenderCacher so its goroutines will only be started on first use.
Avoids starting them when package core is just imported but core.BlockChain isn't used.
2025-01-16 14:36:45 +01:00
Sina M 9b68875d68
beacon/engine: check for empty requests (#31010)
According to
https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#engine_newpayloadv4:

> Elements of the list MUST be ordered by request_type in ascending
order. Elements with empty request_data MUST be excluded from the list.

---------

Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2025-01-15 11:45:20 -07:00
jwasinger 8dfad579e9
eth/gasprice: ensure cache purging goroutine terminates with subscription (#31025) 2025-01-14 16:26:24 +01:00
Felix Lange 04a336aee8
core/types: change SetCodeTx.ChainID to uint256 (#30982)
We still need to decide how to handle non-specfic `chainId` in the JSON
encoding of authorizations. With `chainId` being a uint64, the previous
implementation just used value zero. However, it might actually be more
correct to use the value `null` for this case.
2025-01-14 06:42:18 -07:00
georgehao 1843f27766
all: fix some typos in comments and names (#31023) 2025-01-14 14:16:15 +01:00
rjl493456442 37c0e6992e
cmd, core, miner: rework genesis setup (#30907)
This pull request refactors the genesis setup function, the major
changes are highlighted here:

**(a) Triedb is opened in verkle mode if `EnableVerkleAtGenesis` is
configured in chainConfig or the database has been initialized previously with
`EnableVerkleAtGenesis` configured**.

A new config field `EnableVerkleAtGenesis` has been added in the
chainConfig. This field must be configured with True if Geth wants to initialize 
the genesis in Verkle mode.

In the verkle devnet-7, the verkle transition is activated at genesis.
Therefore, the verkle rules should be used since the genesis. In production
networks (mainnet and public testnets), verkle activation always occurs after
the genesis block. Therefore, this flag is only made for devnet and should be
deprecated later. Besides, verkle transition at non-genesis block hasn't been
implemented yet, it should be done in the following PRs.

**(b) The genesis initialization condition has been simplified**
There is a special mode supported by the Geth is that: Geth can be
initialized with an existing chain segment, which can fasten the node sync
process by retaining the chain freezer folder.

Originally, if the triedb is regarded as uninitialized and the genesis block can
be found in the chain freezer, the genesis block along with genesis state will be
committed. This condition has been simplified to checking the presence of chain
config in key-value store. The existence of chain config can represent the genesis
has been committed.
2025-01-14 11:49:30 +01:00
Paul Lange 864e717b56
core: remove unused function parameters (#31001) 2025-01-13 19:35:49 +01:00