Commit graph

14455 commits

Author SHA1 Message Date
Felix Lange
b92d89681f core/types: transaction and receipt encoding/decoding optimizations (#27976)
Just some minor optimizations I figured out a while ago. By using ReadBytes instead of
Bytes on the rlp stream, we can save the allocation of a temporary buffer for the typed tx
payload.

If kind == rlp.Byte, the size reported by Stream.Kind will be zero, but we need a buffer
of size 1 for ReadBytes. Since typed txs always have to be longer than 1 byte, we can just
return an error for kind == rlp.Byte.

There is a also a small change for Log: since the first three fields of Log are the ones that 
should appear in the canon encoding, we can simply ignore the remaining fields via 
struct tag. Doing this removes an indirection through the rlpLog type.

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Péter Szilágyi
8f5d0635ce cmd, core, params: add support for the Holesky testnet (#28007)
* cmd, core, params: add support for the Holesky testnet

* cmd/devp2p: add support for holesky for the dns crawler
2023-11-10 11:09:46 -06:00
Péter Szilágyi
2fae17c8f6 eth/protocols/eth: stop advertising eth/66 for pathdb nodes (#28006) 2023-11-10 11:09:46 -06:00
Felix Lange
b5c26cadde core: support null balance in genesis (#28005) 2023-11-10 11:09:46 -06:00
aaronbuchwald
1f2bb0106c core/state/snapshot: replace diffToDisk ideal batch size with 64MB (#27977) 2023-11-10 11:09:46 -06:00
Guido Vranken
d1920b4ffe core/vm/runtime: Add Random field to config (#28001) 2023-11-10 11:09:46 -06:00
rjl493456442
f64d516284 eth/catalyst: use block as finalization (#28000) 2023-11-10 11:09:46 -06:00
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