Commit graph

15269 commits

Author SHA1 Message Date
Delweng
b71919e5e2 eth/catalyst: disable heartbeat for simulated beacon node (#27979)
* eth/catalyst: disable heartbeat for simulated beacon node

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

* eth/catalyst: update

* eth/catalyst: disable heartbeat for tester

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2023-11-10 11:09:46 -06:00
Felix Lange
dd6f2f98aa all: use rlp.DecodeBytes instead of rlp.Decode where possible (#27994) 2023-11-10 11:09:46 -06:00
Marius van der Wijden
4c1fe069eb miner: refactor getSealingBlock method (#27993) 2023-11-10 11:09:46 -06:00
lightclient
2099a80396 miner: add to build block with EIP-4844 blobs (#27875)
---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Felix Lange
7ac4bfcf3d core/rawdb: fix 32bit build (#27995) 2023-11-10 11:09:46 -06:00
Martin Holst Swende
b85c87b5d4 core/state: remove public method ForEachStorage (#27986)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Marius van der Wijden
4639725b10 core/rawdb: allocate database keys with explicit size to avoid slice growth (#27772) 2023-11-10 11:09:46 -06:00
cui
98fee83322 crypto/bn256: eliminate dead store (#27944) 2023-11-10 11:09:46 -06:00
ucwong
1fa04ea6e1 les: use new atomic types (#27856)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
0aa81738e6 core/rawdb, ethdb/pebble: avoid fsync db in tests (#27836)
Adds an option to disable fsync for database operations.
This is to make tests faster.
2023-11-10 11:09:46 -06:00
Felix Lange
b3a7b8f766 rlp: remove allocation of bytes.Reader in DecodeBytes (#27987) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
62e19dde73 travis: get rid of old useless GO111MODULE directives (#27991) 2023-11-10 11:09:46 -06:00
Shude Li
c8563890cb account/abi: convert if-else-if chain to tagged switch (#27869)
account/abi: conver if-else-if chain to tagged switch
2023-11-10 11:09:46 -06:00
Martin Holst Swende
be5feb2250 travis: increase travis wait time (#27975) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
22b083a163 cmd/utils: fix a startup issue on deleted chaindata but dangling ancients (#27989) 2023-11-10 11:09:46 -06:00
rjl493456442
1e72cdbd32 eth/catalyst: disable full payload when not in dev mode (#27921)
eth/catalyst: only enable full payload in dev mode
2023-11-10 11:09:46 -06:00
Péter Szilágyi
2aa9c9c87b core, eth, trie: expose more detailed dirty ram tracking for diff layers (#27971) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
9c07079f33 go.mod: update pebble to crl-release-23.1 (#27967) 2023-11-10 11:09:46 -06:00
Delweng
8c74940ebf graphql: fix nil deref on a timer (#27978)
graphql: fix the panic of nil timer.Stop

Signed-off-by: jsvisa <delweng@gmail.com>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
3c23e850d3 rpc: use go-winio for named pipes (#27972)
We're trying a new named pipe library, which should hopefully fix some occasional failures in CI.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Felix Lange
b88138ad05 core: add BeaconRoot to header in GenerateChain (#27974)
Fixes an error in tests of internal/ethapi.
2023-11-10 11:09:46 -06:00
Martin Holst Swende
f28ec27bcd cmd/evm: add back stateroot to jsonl-output (#27968)
The PR #26274 broke the evm statetest command a bit, in that it stopped spitting out the stateroot following a non-successful statetest-execution. 

This PR changes it back, so the stateroot is unconditionally output on stderr, and makes it so fuzzing works again.
2023-11-10 11:09:46 -06:00
Martin Holst Swende
2e9477f46b core, params, beacon/engine: implement EIP 4788 BeaconRoot (#27849)
This change implements "EIP 4788 : Beacon block root in the EVM". It implements version-2 of EPI-4788, main difference being that the contract is an actual contract rather than a precompile, as in #27289.
2023-11-10 11:09:46 -06:00
Marius van der Wijden
4f26ebfa8a go.mod: update docker (#27970) 2023-11-10 11:09:46 -06:00
Martin Holst Swende
ccde357a06 travis, build: update Go to 1.21.0 (#27958)
build: update to go 1.21
2023-11-10 11:09:46 -06:00
shuo
f1575bd9f0 miner: fix reply -> replay typo (#27961)
* typo: reply -> replay

* rebuild
2023-11-10 11:09:46 -06:00
Delweng
01eb95af0f core: ensure txindex will be triggered at least once (#27847)
Currently, we trigger the logic to (un)index transactions when the node receives a new
block. However, in some cases the node may not receive new blocks (eg, when the Geth node
is configured without peer discovery, or when it acts as an RPC node for historical-only
data).

In these situations, the Geth node user may not have previously configured txlookuplimit
(i.e. the default of around one year), but later realizes they need to index all
historical blocks. However, adding txlookuplimit=0 and restarting geth has no effect. This
change makes it check for required indexing work once, on startup, to fix the issue.

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Delweng
4f92d3f516 internal/ethapi: add testcases for blobTx (#27818)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
jwasinger
9070fc89a9 eth/catalyst: set finalized block hash properly in dev mode (#27886)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Marius van der Wijden
f2b58906fb eth: ignore genesis block on importChain (#27956) 2023-11-10 11:09:46 -06:00
Marius van der Wijden
06434771a1 trie: reduce allocs in recHash (#27770) 2023-11-10 11:09:46 -06:00
Marius van der Wijden
e93739e06c internal/ethapi: eth API changes needed for 4844 (#27928)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Roberto Bayardo
8be8e98163 internal/ethapi: optimize & clean up EstimateGas (#27710)
Optimizations:

- Previously, if a transaction was reverting, EstimateGas would exhibit worst-case behavior and binary search up to the max gas limit (~40 state-clone + tx executions). This change allows EstimateGas to return after only a single unconstrained execution in this scenario.
- Uses the gas used from the unconstrained execution to bias the remaining binary search towards the likely solution in a simple way that doesn't impact the worst case. For a typical contract-invoking transaction, this reduces the median number of state-clone+executions from 25 to 18 (28% reduction).

Cleanup:

- added & improved function + code comments
- correct the EstimateGas documentation to clarify the gas limit determination is at latest block, not pending, if the blockNr is unspecified.
2023-11-10 11:09:46 -06:00
Delweng
a0330ade5f eth/downloader: fix rare crash when parent header missing in db (#27945)
ReadSkeletonHeader can return nil if the header is missing, so we should
not access fields on it. Note that calling .Hash() on a nil header is fine, so there 
is no need to actually check for nil.

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
10133ba062 core/txpool/legacypool: protect cache with mutex (#27898)
This change fixes the a potential race by using mutexes when the m.cache is read or modified.
2023-11-10 11:09:46 -06:00
lightclient
db5684444a core/forkid: correctly compute forkid when timestamp fork is activated in genesis (#27895)
This changes the forkID calculation to ignore time-based forks that occurred before the
genesis block. It's supposed to be done this way because the spec says:

> If a chain is configured to start with a non-Frontier ruleset already in its genesis, that is NOT considered a fork.
2023-11-10 11:09:46 -06:00
lightclient
93dbe130dd core/types: fix unmarshalling of BlobTx values (#27939)
FromBig returns true *when overflow occurs*
2023-11-10 11:09:46 -06:00
Delweng
ecd50dade0 node: increase batch limits for auth rpc API (#27924)
This raises the JSON-RPC batch request limits significantly for the engine API endpoint.
The limits are now also hard-coded, so users won't get them wrong. I have chosen these limits:

    maximum batch items: 2000
    maximum batch response size: 250MB

While it would also be possible to disable batch limits completely for the engine API, 
I think having some limits is a good safety net against misbehaving CLs. Since this
 isn't configurable, we really want to ensure this limit will never become an issue in the
 CL/EL communication, so I set them quite high.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
667750e013 build: remove ubuntu kinetic (deprecated) (#27933) 2023-11-10 11:09:46 -06:00
Joe Netti
77b5584250 eth/tracers/js: use t.toBig on ctx.GasPrice for js tracing (#27903)
This change fixes a bug in js tracer, where `ctx.GasPrice.toString(16)` returns a number string in base `10`.
2023-11-10 11:09:46 -06:00
Paweł Bylica
6189a353d7 trie: add tests for "short" nodes in StackTrie (#27932) 2023-11-10 11:09:46 -06:00
lonika
fdad633b8a crypto/bls12381: fix typo in comment (#27930) 2023-11-10 11:09:46 -06:00
Delweng
389612c245 internal/ethapi: implement eth_getBlockReceipts (#27702) 2023-11-10 11:09:46 -06:00
ucwong
381133b606 go.mod: upgrade goja (#27899) 2023-11-10 11:09:46 -06:00
Delweng
a6e1f48a51 cmd/utils: restore support for txlookuplimit flag (#27917)
This fixes a regression where -txlookuplimit was not applied anymore.
2023-11-10 11:09:46 -06:00
Felix Lange
278a4af91f core/types: support for optional blob sidecar in BlobTx (#27841)
This PR removes the newly added txpool.Transaction wrapper type, and instead adds a way
of keeping the blob sidecar within types.Transaction. It's better this way because most
code in go-ethereum does not care about blob transactions, and probably never will. This
will start mattering especially on the client side of RPC, where all APIs are based on
types.Transaction. Users need to be able to use the same signing flows they already
have.

However, since blobs are only allowed in some places but not others, we will now need to
add checks to avoid creating invalid blocks. I'm still trying to figure out the best place
to do some of these. The way I have it currently is as follows:

- In block validation (import), txs are verified not to have a blob sidecar.
- In miner, we strip off the sidecar when committing the transaction into the block.
- In TxPool validation, txs must have a sidecar to be added into the blobpool.
  - Note there is a special case here: when transactions are re-added because of a chain
    reorg, we cannot use the transactions gathered from the old chain blocks as-is,
    because they will be missing their blobs. This was previously handled by storing the
    blobs into the 'blobpool limbo'. The code has now changed to store the full
    transaction in the limbo instead, but it might be confusing for code readers why we're
    not simply adding the types.Transaction we already have.

Code changes summary:

- txpool.Transaction removed and all uses replaced by types.Transaction again
- blobpool now stores types.Transaction instead of defining its own blobTx format for storage
- the blobpool limbo now stores types.Transaction instead of storing only the blobs
- checks to validate the presence/absence of the blob sidecar added in certain critical places
2023-11-10 11:09:46 -06:00
Felix Lange
21e3ca2059 internal/build: apply -ubuntu to env (#27910) 2023-11-10 11:09:46 -06:00
Felix Lange
136f846619 go.mod, build: upgrade c-kzg-4844 (#27907)
This upgrades to the latest release of ckzg, and also attempts to fix some blst-related
build errors that occur on launchpad.net.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
1c411fcea2 all: update golang/x/ext and fix slice sorting fallout (#27909)
The Go authors updated golang/x/ext to change the function signature of the slices sort method. 
It's an entire shitshow now because x/ext is not tagged, so everyone's codebase just 
picked a new version that some other dep depends on, causing our code to fail building.

This PR updates the dep on our code too and does all the refactorings to follow upstream...
2023-11-10 11:09:46 -06:00
Péter Szilágyi
e7bebb9200 trie/triedb/pathdb: make shutdown journal log friendlier (#27905) 2023-11-10 11:09:46 -06:00