Commit graph

14280 commits

Author SHA1 Message Date
rjl493456442
cee45268f8 trie: remove parameter 'fromLevel' in Prove (#27512)
This removes the feature where top nodes of the proof can be elided.
It was intended to be used by the LES server, to save bandwidth 
when the client had already fetched parts of the state and only needed
some extra nodes to complete the proof. Alas, it never got implemented
in the client.
2023-11-10 11:09:46 -06:00
Marius van der Wijden
143c5214c9 go.mod: update kzg libraries to use big-endian (#27510)
* go.mod: update kzg libraries to use big-endian

* go.sum: ran go mod tidy

* core/testdata/precompiles: fix blob verification test

* core/testdata/precompiles: fix blob verification test
2023-11-10 11:09:46 -06:00
Dan Laine
ad4c89228c tests, trie: use slices package for sorting (#27496)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Dan Laine
051b1a1fd9 internal/ethapi, les: use slices package for sorting (#27492)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Dan Laine
cd00ee32ba consensus/clique: use slices package for sorting (#27488)
Also adds Address.Less for sorting use in other packages.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Dan Laine
e39f48953a metrics: use slices package for sorting (#27493)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Sanghee Choi
1b46eaa4bc consensus/clique: fix typo in comment (#27503) 2023-11-10 11:09:46 -06:00
John Chase
d27401046d cmd/evm: fix typos in documentation (#27501) 2023-11-10 11:09:46 -06:00
Dan Laine
90b87be3c1 cmd/devp2p: use slices package for sorting (#27487) 2023-11-10 11:09:46 -06:00
Dan Laine
8f278728b1 accounts/keystore: use slices package for sorting (#27485)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Koichi Shiraishi
63eb2e901c rpc: avoid use of cgo by hard-coding maxPathSize (#27447)
Package rpc uses cgo to find the maximum UNIX domain socket path 
length. If exceeded, a warning is printed. This is the only use of cgo in this
package. It seems excessive to depend on cgo just for this warning, so
we now hard-code the usual limit for Linux instead.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
e9686cee73 core/txpool/legacypool: handle missing head in reset (#27479)
Fixes #27301, a crash that could occur during txpool reorg handling.
2023-11-10 11:09:46 -06:00
hero5512
d97bfa6e6c core/txpool/legacypool: remove redundant check for floatingRatio == 0 (#27477)
floatingRatio is a constant and always non-zero. So there is no need to
check for == 0.
2023-11-10 11:09:46 -06:00
John Chase
082ff5369b internal/jsre/deps: fix typos in web3.js (#27500) 2023-11-10 11:09:46 -06:00
Dan Laine
42aebf3965 ethdb/dbtest: use slices package for sorting (#27491) 2023-11-10 11:09:46 -06:00
Dan Laine
9bcadfbf2f p2p: use slices package for sorting (#27494)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
jin
0a44648415 core/txpool/legacypool: reheap the tx list if london fork not enabled (#27481)
This change ensures Reheap will be called even before the London fork activates.
Since Reheap would otherwise only be called through `SetBaseFee` after London,
the list would just keep growing if the fork was not enabled or not reached yet.
2023-11-10 11:09:46 -06:00
Dan Laine
3ecc4c4b2d build: use slices package for sorting (#27486) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
3c12101056 all: move main transaction pool into a subpool (#27463)
* all: move main transaction pool into a subpool

* go.mod: remove superfluous updates

* core/txpool: review fixes, handle txs rejected by all subpools

* core/txpool: typos
2023-11-10 11:09:46 -06:00
John Chase
f0672a7df0 rlp: fix typos (#27484)
fix typos

Co-authored-by: john <yejiarui@123.com>
2023-11-10 11:09:46 -06:00
cui fliter
f588aec3cb cmd/evm: fix typos in docs (#27478)
fix some typos

Signed-off-by: cui fliter <imcusg@gmail.com>
2023-11-10 11:09:46 -06:00
Martin Holst Swende
ee79490ec6 core/types: add support for BlobTxType receipts (#27470)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
aaronbuchwald
44a8cecbc6 core: remove unnecessary log copy (#27475)
The logs in this function are pulled straight from disk in rawdb.ReadRawReceipts and 
also modified in receipts.DeriveFields, so removing the copy should be fine.
2023-11-10 11:09:46 -06:00
Sina Mahmoodi
797f6d0209 eth/tracers: refactor exporting js buffer (#27472)
We had to do this workaround because it wasn't possible to export typed arrays from
JS to []byte. This was added in dop251/goja@2352993, so we can use the better way now.
2023-11-10 11:09:46 -06:00
Sanghee Choi
2df602a332 node: remove unused error return from Attach (#27450)
node: Delete the unused error from return parameters of Node.Attach() func
2023-11-10 11:09:46 -06:00
zhiqiangxu
e851e46067 rpc: add method to test for subscription support (#25942)
This adds two ways to check for subscription support. First, one can now check
whether the transport method (HTTP/WS/etc.) is capable of subscriptions using
the new Client.SupportsSubscriptions method.

Second, the error returned by Subscribe can now reliably be tested using this
pattern:
    
    sub, err := client.Subscribe(...)
    if errors.Is(err, rpc.ErrNotificationsUnsupported) {
        // no subscription support
    }

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Freeman Jiang
120956b80b core/types: add "chainID" field to legacy tx JSON encoding (#27452)
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2023-11-10 11:09:46 -06:00
mmsqe
189a756134 rpc: add limit for batch request items and response size (#26681)
This PR adds server-side limits for JSON-RPC batch requests. Before this change, batches
were limited only by processing time. The server would pick calls from the batch and
answer them until the response timeout occurred, then stop processing the remaining batch
items.

Here, we are adding two additional limits which can be configured:

- the 'item limit': batches can have at most N items
- the 'response size limit': batches can contain at most X response bytes

These limits are optional in package rpc. In Geth, we set a default limit of 1000 items
and 25MB response size.

When a batch goes over the limit, an error response is returned to the client. However,
doing this correctly isn't always possible. In JSON-RPC, only method calls with a valid
`id` can be responded to. Since batches may also contain non-call messages or
notifications, the best effort thing we can do to report an error with the batch itself is
reporting the limit violation as an error for the first method call in the batch. If a batch is
too large, but contains only notifications and responses, the error will be reported with
a null `id`.

The RPC client was also changed so it can deal with errors resulting from too large
batches. An older client connected to the server code in this PR could get stuck
until the request timeout occurred when the batch is too large. **Upgrading to a version
of the RPC client containing this change is strongly recommended to avoid timeout issues.**

For some weird reason, when writing the original client implementation, @fjl worked off of
the assumption that responses could be distributed across batches arbitrarily. So for a
batch request containing requests `[A B C]`, the server could respond with `[A B C]` but
also with `[A B] [C]` or even `[A] [B] [C]` and it wouldn't make a difference to the
client.

So in the implementation of BatchCallContext, the client waited for all requests in the
batch individually. If the server didn't respond to some of the requests in the batch, the
client would eventually just time out (if a context was used).

With the addition of batch limits into the server, we anticipate that people will hit this
kind of error way more often. To handle this properly, the client now waits for a single
response batch and expects it to contain all responses to the requests.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
hero5512
e2e4193003 internal/ethapi: remove error return on RPCMarshalBlock (#27449)
rm error when marshal block to rpc type allen
2023-11-10 11:09:46 -06:00
jwasinger
a3f24fb625 miner: log number of withdrawals in block upon payload update (#27457) 2023-11-10 11:09:46 -06:00
Delweng
dc18557d73 eth/filters: reuse handleLogs method for removed logs (#27438) 2023-11-10 11:09:46 -06:00
KAI
bfc46a4913 accounts/keystore: handle error for invalid key in DecryptKey (#27432)
Co-authored-by: KAI <kaili@coinsummer.io>
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-11-10 11:09:46 -06:00
Stephen Guo
5e0fadb357 rlp: use identical receiver names for encBuffer methods (#27430) 2023-11-10 11:09:46 -06:00
Sina Mahmoodi
19aebbdd1b graphql: implement withdrawals (EIP-4895) (#27072)
implements withdrawals in graphql as per https://github.com/ethereum/execution-apis/pull/400
2023-11-10 11:09:46 -06:00
Delweng
6d231bbe66 eth,core: add api debug_getTrieFlushInterval (#27303)
* core,eth: add api debug_getTrieFlushInterval

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

* eth/api_debug: comment of SetTrieFlushInterval

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

* Apply suggestions from code review

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-11-10 11:09:46 -06:00
Péter Szilágyi
4b555c7682 core/txpool: make transaction validation reusable across packages (pools) (#27429)
* core/txpool: abstraction prep work for secondary pools (blob pool)

* core/txpool: leave subpool concepts to a followup pr

* les: fix tests using hard coded errors

* core/txpool: use bitmaps instead of maps for tx type filtering
2023-11-10 11:09:46 -06:00
Paul Lange
abd1ff83d0 les: remove unused var AdvertiseProtocolVersions (#27405) 2023-11-10 11:09:46 -06:00
Daniel Katzan
210e688a5c core/txpool: fix minor flaw in isGapped check (#27404)
This fix a minor implementation issue with the newly introduced isGapped function and it is described in ticket: https://github.com/ethereum/go-ethereum/issues/27401
2023-11-10 11:09:46 -06:00
Martin Holst Swende
df5a104045 cmd/evm: make evm blocktest output logs if so instructed (#27396)
* cmd/evm: make evm blocktest output logs if so instructed

* Apply suggestions from code review

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

---------

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2023-11-10 11:09:46 -06:00
rjl493456442
1b82886dec core/state/snapshot, core/types, eth: move account definition to type (#27323)
* core/state/snapshot, core/types, eth: move account definition to type

* core, eth: revert snapshot Account API change
2023-11-10 11:09:46 -06:00
Marius van der Wijden
45907213fb core: 4844 opcode and precompile (#27356)
* core: crypto: implement BLOBHASH and pointEval precompile

* core: crypto: fixed nitpicks, moved precompile return value

* core/vm: fix review comments
2023-11-10 11:09:46 -06:00
rjl493456442
f60b50e6d3 core/state: clear out cached state data when reset occurs (#27376)
* core/state: remove cached snap data if reset occurs

* core/state: address comment from peter

* core/state: skip revert in case data is nil
2023-11-10 11:09:46 -06:00
John Chase
8d91a3e6be graphql: simplify tx resolve (#27285) 2023-11-10 11:09:46 -06:00
Péter Szilágyi
0968b3d498 eth/downloader: drop beacon head updates if the syncer is restarting (#27397)
* eth/downloader: drop beacon head updates if the syncer is restarting

* eth/donwloader: v2 of the goroutine spike preventer
2023-11-10 11:09:46 -06:00
Péter Szilágyi
17332a110e all: remove the Rinkeby testnet (#27406) 2023-11-10 11:09:46 -06:00
rjl493456442
68dea627c4 core/state: mark account as dirty when resetObject occurs (#27339)
This changes the journal logic to mark the state object dirty immediately when it
is reset. 

We're mostly adding this change to appease the fuzzer. Marking it dirty immediately
makes no difference in practice because accounts will always be modified by EVM
right after creation.
2023-11-10 11:09:46 -06:00
jin
d7bb325997 internal/web3ext: fix parameter count of miner_start (#27400) 2023-11-10 11:09:46 -06:00
Guillaume Ballet
797c10068e core/state: move slot RLP encoding into the MPT implementation (#27000)
Continuing with a series of PRs to make the Trie interface more generic, this PR moves
the RLP encoding of storage slots inside the StateTrie and light.Trie implementations,
as other types of tries don't use RLP.
2023-11-10 11:09:46 -06:00
Felix Lange
c51cd2d8f8 p2p/discover: add Table configuration and Nodes method (#27387)
* p2p/discover: remove ReadRandomNodes

Even though it's public, this method is not callable by code outside of
package p2p/discover because one can't get a valid instance of Table.

* p2p/discover: add Table.Nodes

* p2p/discover: make Table settings configurable

In unit tests and externally developed cmd/devp2p test runs, it can be
useful to tune the timer intervals used by Table.
2023-11-10 11:09:46 -06:00
Péter Szilágyi
0eb3a6cdbb core, eth/downloader: validate blobtx.To at serialization time (#27393) 2023-11-10 11:09:46 -06:00