Commit Graph

14829 Commits

Author SHA1 Message Date
jwasinger
8c288b528d
internal/ethapi: use same state for each invocation within EstimateGas (#27505)
EstimateGas repeatedly executes a transaction, performing a binary search with multiple gas prices to determine proper pricing. Each call retrieves a new copy of the state (https://github.com/ethereum/go-ethereum/blob/master/internal/ethapi/api.go#L1017) . Because the pending/latest state can change during the execution of EstimateGas, this can potentially cause strange behavior (as noted here: https://github.com/ethereum/go-ethereum/pull/27502#issue-1761957009).

This PR modifies EstimateGas to retrieve the state once and use a copy of it for every call invocation it does.
2023-06-20 08:40:18 -04:00
Felix Lange
1affc1c08d
core/txpool: remove use of errors.Join function (#27523)
his function was added in Go 1.20, but our compatibility target
is Go 1.19.
2023-06-20 13:51:59 +02:00
Dan Laine
154b016b6c
core: use slices package for sorting (#27489)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-20 11:58:47 +02:00
Delweng
84b05d4f34
internal/build: ignore some files in FindMainPackages (#27521) 2023-06-20 10:42:13 +02:00
philip-morlier
8a33d8e506 added meta blockProcessingError to test 2023-06-19 20:59:18 -07:00
Dan Laine
b1ef0bfe03
eth: use slices package for sorting (#27490)
Also adds Hash.Less method for sorting purposes.

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-19 23:38:57 +02:00
hero5512
9a167c45d1
core/txpool/legacypool: narrow down the scope of the variable (#27471)
Variables discarded, included can be defined closer to their usage.

Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-06-19 23:30:39 +02:00
rjl493456442
ceca4578ca
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-06-19 16:28:40 +02:00
Marius van der Wijden
091c25d983
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-06-19 15:08:13 +03:00
Dan Laine
50ecb16de0
tests, trie: use slices package for sorting (#27496)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-19 11:41:31 +02:00
Dan Laine
87e510d963
internal/ethapi, les: use slices package for sorting (#27492)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-19 11:33:48 +02:00
Dan Laine
a848212709
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-06-19 09:04:16 +02:00
Dan Laine
4367ab499f
metrics: use slices package for sorting (#27493)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-19 08:53:15 +02:00
Sanghee Choi
760fd0c79b
consensus/clique: fix typo in comment (#27503) 2023-06-19 08:47:00 +02:00
John Chase
cd3b8c3d78
cmd/evm: fix typos in documentation (#27501) 2023-06-19 08:44:54 +02:00
Dan Laine
4544dc5f32
cmd/devp2p: use slices package for sorting (#27487) 2023-06-19 08:42:49 +02:00
Dan Laine
311b742c84
accounts/keystore: use slices package for sorting (#27485)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-19 08:34:47 +02:00
Koichi Shiraishi
f0b5af74a3
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-06-19 08:06:58 +02:00
Martin Holst Swende
e4660a1181
core/txpool/legacypool: handle missing head in reset (#27479)
Fixes #27301, a crash that could occur during txpool reorg handling.
2023-06-19 07:58:04 +02:00
hero5512
a71b9b9ffa
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-06-19 07:52:40 +02:00
John Chase
168d0cc3b3
internal/jsre/deps: fix typos in web3.js (#27500) 2023-06-19 07:50:56 +02:00
Dan Laine
5d75123cb7
ethdb/dbtest: use slices package for sorting (#27491) 2023-06-19 07:48:47 +02:00
Dan Laine
289c6c3b15
p2p: use slices package for sorting (#27494)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-19 07:48:12 +02:00
jin
46ec972c9c
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-06-18 22:43:53 +02:00
Dan Laine
36ca59f1ec
build: use slices package for sorting (#27486) 2023-06-18 15:09:00 +02:00
Péter Szilágyi
d40a255e97
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-06-16 15:29:40 +03:00
John Chase
c375936e81
rlp: fix typos (#27484)
fix typos

Co-authored-by: john <yejiarui@123.com>
2023-06-16 15:21:43 +03:00
cui fliter
604da5c84b
cmd/evm: fix typos in docs (#27478)
fix some typos

Signed-off-by: cui fliter <imcusg@gmail.com>
2023-06-15 08:55:00 -04:00
Martin Holst Swende
9cf9fae668
core/types: add support for BlobTxType receipts (#27470)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-06-15 14:18:54 +02:00
aaronbuchwald
93ecd77d77
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-06-15 13:52:06 +02:00
philip-morlier
b19d7f9f9e Merge remote-tracking branch 'origin/develop' into feature/old-consensus-engine 2023-06-14 22:24:35 -07:00
philip-morlier
fee25089a9 Added HookTester back into main. 2023-06-14 22:24:08 -07:00
Sina Mahmoodi
7823ff6d06
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-06-14 19:07:24 +02:00
Philip Morlier
366f480bc1
Merge pull request #78 from cerc-io/fix-subscription-methods
Fix subscription method registration
2023-06-14 09:44:27 -07:00
Sanghee Choi
acc2a2ac61
node: remove unused error return from Attach (#27450)
node: Delete the unused error from return parameters of Node.Attach() func
2023-06-14 08:24:47 -04:00
zhiqiangxu
6f08c2f3f1
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-06-14 14:04:41 +02:00
philip-morlier
1bf1a5634e Merge remote-tracking branch 'origin/develop' into feature/old-consensus-engine 2023-06-13 22:52:01 -07:00
philip-morlier
23c0ca58af trieFlushClone test experiment 2023-06-13 13:13:13 -07:00
Freeman Jiang
8bbaf882a6
core/types: add "chainID" field to legacy tx JSON encoding (#27452)
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
2023-06-13 14:46:45 +02:00
mmsqe
f3314bb6df
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-06-13 13:38:58 +02:00
hero5512
5ac4da3653
internal/ethapi: remove error return on RPCMarshalBlock (#27449)
rm error when marshal block to rpc type allen
2023-06-13 03:02:11 -04:00
jwasinger
174d267f48
miner: log number of withdrawals in block upon payload update (#27457) 2023-06-13 02:55:05 -04:00
Philip Morlier
a20fadc454
Merge pull request #79 from openrelayxyz/feature/consensus-engine
Feature/consensus engine
2023-06-12 16:28:47 -07:00
philip-morlier
80956ac723 removed unnecessary comments from wrappers/engine.go 2023-06-12 15:08:37 -07:00
philip-morlier
d8d864768a Updated mod and sum to reflect v1.2.0
Also changed the injection and hook from hooktester to blockchain().
2023-06-12 13:37:29 -07:00
philip-morlier
7434ccb8c8 Initial commit of stand alone consensus engine work. 2023-06-12 09:52:46 -07:00
f7ff01fd54 fix plugin subscription method registration 2023-06-10 01:51:39 +08:00
a9c2d243c5 clean up/copyedit 2023-06-09 23:07:13 +08:00
Delweng
281e8cd5ab
eth/filters: reuse handleLogs method for removed logs (#27438) 2023-06-08 11:40:22 +02:00
KAI
5c51ef8527
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-06-07 15:10:42 +02:00