Commit Graph

14703 Commits

Author SHA1 Message Date
Felix Lange
2a6beb6a39
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-08-14 10:13:34 +02:00
Felix Lange
68860063fb
internal/build: apply -ubuntu to env (#27910) 2023-08-12 10:32:50 +02:00
Felix Lange
e91b21ce2b
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-08-12 00:21:46 +02:00
Péter Szilágyi
be65b47645
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-08-12 00:04:12 +02:00
Péter Szilágyi
0ce331f56a
trie/triedb/pathdb: make shutdown journal log friendlier (#27905) 2023-08-11 17:05:35 +03:00
DongXi Huang
80b76a9527
core/types: remove duplication in eip2930 signer (#27860)
Remove duplication in signer
---------

Co-authored-by: GDdark <huangdongxi@minijoy.work>
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-08-11 09:50:57 -04:00
Felix Lange
8f8ef2bc0c
rpc: attempt to fix ping/pong logic race (#27733)
This should fix #27726. With enough load, it might happen that the SetPongHandler 
callback gets invoked before the call to SetReadDeadline is made in pingLoop. When 
this occurs, the socket will end up with a 30s read deadline even though it got the pong,
which will lead to a timeout.

The fix here is processing the pong on pingLoop, synchronizing with the code that 
sends the ping.
2023-08-11 15:16:45 +02:00
Delweng
35f7f3d015
ethdb/leveldb: support more than 7 levels in metrics (#27904) 2023-08-11 15:15:49 +02:00
imulmat4
6ddb92cac3
core/txpool/blobpool: fix metrics name for prometheus export (#27901) 2023-08-11 10:12:26 +03:00
Péter Szilágyi
e2507a17e8 params: switch release family to 1.13 to prep for PBSS 2023-08-10 22:22:17 +03:00
rjl493456442
503f1f7ada
all: activate pbss as experimental feature (#26274)
* all: activate pbss

* core/rawdb: fix compilation error

* cma, core, eth, les, trie: address comments

* cmd, core, eth, trie: polish code

* core, cmd, eth: address comments

* cmd, core, eth, les, light, tests: address comment

* cmd/utils: shorten log message

* trie/triedb/pathdb: limit node buffer size to 1gb

* cmd/utils: fix opening non-existing db

* cmd/utils: rename flag name

* cmd, core: group chain history flags and fix tests

* core, eth, trie: fix memory leak in snapshot generation

* cmd, eth, internal: deprecate flags

* all: enable state tests for pathdb, fixes

* cmd, core: polish code

* trie/triedb/pathdb: limit the node buffer size to 256mb

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
2023-08-10 22:21:36 +03:00
Sina Mahmoodi
5e89ff4d6b
graphql: validate block params (#27876)
Block takes a number and a hash. The spec is unclear on what should happen in this case, leaving it an implemenation detail. With this change, we return an error in case both number and hash are passed in.
2023-08-10 07:00:52 -04:00
dependabot[bot]
86d7f5aeee
deps: update supranational/blst to 0.3.11 (#27890)
build(deps): bump github.com/supranational/blst

Bumps [github.com/supranational/blst](https://github.com/supranational/blst) from 0.3.11-0.20230406105308-e9dfc5ee724b to 0.3.11.
- [Release notes](https://github.com/supranational/blst/releases)
- [Commits](https://github.com/supranational/blst/commits/v0.3.11)

---
updated-dependencies:
- dependency-name: github.com/supranational/blst
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-10 06:50:09 -04:00
Martin Holst Swende
8d1db1601d
eth/filters, core/rawdb: remove unused param, refactor filtering-loop (#27891)
This change removes a chainconfig parameter passed into rawdb.ReadLogs, which is not used nor needed.
It also modifies the filter loop slightly, avoiding a labeled break and instead using a method.

This change does not modify any behaviour.
2023-08-10 06:49:05 -04:00
Felix Lange
d9a8b0ff71 params: begin v1.12.2 release cycle 2023-08-10 12:13:15 +02:00
Felix Lange
9c216bd6cb params: release go-ethereum v1.12.1 2023-08-10 12:10:33 +02:00
Guillaume Ballet
67979022aa
core/state: move UpdateContractCode before the trie hash is computed (#27853)
Context: The UpdateContractCode method was introduced for the state storage commitment
schemes that include the whole code for their commitment computation. It must therefore be called
before the root hash is computed at the end of IntermediateRoot.

This should have no impact on the MPT since, in this context, the method is a no-op.
2023-08-09 18:02:45 +02:00
Delweng
10d9f9377b
graphql: add yParity field for transactions (#27882)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-08-09 17:57:57 +02:00
Felix Lange
7ec60d5f0c
p2p: move ping handling into pingLoop goroutine (#27887)
Moving the response sending there allows tracking all peer goroutines
in the peer WaitGroup.
2023-08-09 16:00:31 +02:00
Martin Holst Swende
e13fa32cea
core/vm: update 4844 - point evaluation precompile address (#27874) 2023-08-08 15:54:19 +03:00
Martin Holst Swende
0d772b9f09
graphql: avoid greedy allocation (#27873)
Fixes a graphql-dos

---------

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2023-08-08 07:35:58 -04:00
ucwong
6d2bcb911a
p2p/simulations/examples: use atomic.Int64 (#27861) 2023-08-07 18:30:05 +02:00
Amin Talebi
eeebb07c73
internal/ethapi: add state override to estimateGas (#27845) 2023-08-07 16:03:57 +02:00
ucwong
d14c07d91e
accounts: use atomic type (#27857) 2023-08-07 03:11:50 -04:00
ucwong
857476753d
internal: use atomic type (#27858) 2023-08-07 03:11:06 -04:00
Christopher Harrison
60070fe5c6
internal/ethapi, graphql: correct comments about gas price logic (#27752) 2023-08-05 01:08:53 +02:00
ucwong
5c30541c2a
log: use atomic types (#27763)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-08-05 00:58:53 +02:00
Felix Lange
bb148dd342
core/types: support yParity field in JSON transactions (#27744)
This adds support for the "yParity" field in transaction objects returned by RPC
APIs. We somehow forgot to add this field even though it has been in the spec for
a long time.
2023-08-05 00:54:55 +02:00
Darioush Jalali
57cdbaef30
all: remove trailing whitespace (#27741) 2023-08-05 00:24:32 +02:00
Felix Lange
df544350bc
core/types: fix immutability guarantees in Block (#27844)
This change rearranges the accessor methods in block.go and fixes some minor issues with
the copy-on-write logic of block data. Fixed issues:

- Block.WithWithdrawals did not create a shallow copy of the block.

- Block.WithBody copied the header unnecessarily, and did not preserve withdrawals.

However, the bugs did not affect any code in go-ethereum because blocks are *always*
created using NewBlockWithHeader().WithBody().WithWithdrawals()
2023-08-04 14:16:23 +02:00
Péter Szilágyi
6e934f40f9
eth/protocols/snap: fix batch writer when resuming an aborted sync (#27842) 2023-08-03 14:51:02 +03:00
Marius Kjærstad
8224bb9218
build: upgrade -dlgo version to Go 1.20.7 (#27835) 2023-08-02 12:53:05 +03:00
ucwong
d04bde0a20
p2p: use atomic types (#27764)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-08-01 23:20:52 +02:00
Delweng
ff97b4cc6a
cmd/geth: disable automaxprocs log (#27814)
Co-authored-by: Felix Lange <fjl@twurst.com>
2023-08-01 18:02:36 +02:00
rjl493456442
7de748d3f6
all: implement path-based state scheme (#25963)
* all: implement path-based state scheme

* all: edits from review

* core/rawdb, trie/triedb/pathdb: review changes

* core, light, trie, eth, tests: reimplement pbss history

* core, trie/triedb/pathdb: track block number in state history

* trie/triedb/pathdb: add history documentation

* core, trie/triedb/pathdb: address comments from Peter's review

Important changes to list:

- Cache trie nodes by path in clean cache
- Remove root->id mappings when history is truncated

* trie/triedb/pathdb: fallback to disk if unexpect node in clean cache

* core/rawdb: fix tests

* trie/triedb/pathdb: rename metrics, change clean cache key

* trie/triedb: manage the clean cache inside of disk layer

* trie/triedb/pathdb: move journal function

* trie/triedb/path: fix tests

* trie/triedb/pathdb: fix journal

* trie/triedb/pathdb: fix history

* trie/triedb/pathdb: try to fix tests on windows

* core, trie: address comments

* trie/triedb/pathdb: fix test issues

---------

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-08-01 15:17:32 +03:00
ucwong
9d744f0ca8
cmd/bootnode: fix timer leak (#27754) 2023-08-01 14:12:11 +02:00
Delweng
f404a2d0f1
cmd/evm: set ExcessBlobGas from env (#27796)
Sets the `currentExcessBlobGas` from env, alternatively calculates it based on `parentExcessBlobGas` and `parentBlobGasUsed`. It then emits the `currentExcessBlobGas` and `currentBlobGasUsed` into the output, to be used as parent-values for a future iteration. 

Closes #27785
Closes #27783

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2023-08-01 07:58:26 -04:00
Delweng
7c95ebd63d
consensus/misc: move eip1559 into a package (#27828)
* consensus/misc: move eip1559 as a sub directory

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

* consensus/misc: package name

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

* all: eip1559

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

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2023-08-01 12:58:45 +03:00
rjl493456442
2fd77a6a7e
core/txpool/blobpool: remove error log when finalized block is nil (#27822)
* core/txpool/blobpool: remove error log when finalized block is nil

* core/txpool/blobpool: take peter's suggestion
2023-08-01 10:09:20 +03:00
Martin Holst Swende
852be575e1
tests: make tests pass on windows/386 (#27821)
* tests: split up state test execution

* Revert "tests: split up state test execution"

This reverts commit 96017c248c85d24e93ad013a2bbe8b38c99327c0.

* build: bump test timeout to 20 minutes
2023-08-01 10:08:19 +03:00
Delweng
3ca92f70e5
all: replace data gas to blob gas in comments (#27825)
* eth: excessDataGas -> excessBlobGas

* consensus: data gas -> blob gas

* core: data gas -> blob gas

* params: data gas -> blob gas
2023-08-01 10:07:25 +03:00
Zig Blathazar
4e9775668e
cmd/bootnode: defer udp connection close (#27787) 2023-07-31 13:15:13 -04:00
rjl493456442
817553cc28
core, trie: track state change set with account address (#27815) 2023-07-31 15:07:51 +03:00
Delweng
43a1a48ee2
core: remove pointless check for excessBlobGas nilness (#27797)
* core: check excessBlobGas in front

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

* core: no need to manual panic

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

* core: no comment

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

---------

Signed-off-by: jsvisa <delweng@gmail.com>
2023-07-31 10:54:26 +03:00
Shude Li
5a4eba6886
eth: conver if-else-if chain to tagged switch (#27816) 2023-07-31 10:22:36 +03:00
Shude Li
95cc7bf4f8
cmd/geth: import package catalyst once (#27803) 2023-07-31 08:18:13 +03:00
Mario Vega
8f2ae29b8f
core/types: fix receipt blob fields marshaling (#27793) 2023-07-28 10:08:38 +03:00
Marius van der Wijden
d9556533c3
core/types: put header fields in correct order (#27791) 2023-07-27 17:15:08 +03:00
Péter Szilágyi
57268f7e6c
all: rename dataGas to blobGas (#27789) 2023-07-27 16:53:28 +03:00
Péter Szilágyi
0f4b21feac
core/txpool/blobpool: fix a merge conflict from a package rename (#27790) 2023-07-27 14:53:05 +03:00