Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geth v1.12.2 x #315

Closed
wants to merge 114 commits into from
Closed

Geth v1.12.2 x #315

wants to merge 114 commits into from

Conversation

darioush
Copy link
Collaborator

@darioush darioush commented Sep 1, 2023

Why this should be merged

Updates go-ethereum to v1.12.2 dependency.

How this works

Takes code from upstream.
The following commits were omitted:

I also bumped the exp library in avalanchego, this involves a change from the sorting fn Less(a, b) -> bool to Cmp(a, b) -> int, and using both versions together is not possible.
If we want to avoid dealing with this change for now, we can revert to using geth v1.12.1 temporarily.

Additionally, per some internal discussions, I have removed the freezer related functionality from the PBSS code, but have tried to take the rest of the changes for aligning with upstream here.
I have a draft PR for adding the freezer functionality and / or interfaces if we want them.

How this was tested

CI

holiman and others added 30 commits August 30, 2023 13:10
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* core: replace noarg fmt.Errorf with errors.New

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

* console: replace noarg fmt.Errorf with errors.New

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

* core: go autoimport

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

* core: dry

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

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* accounts: replace noarg fmt.Errorf with errors.New

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

* accounts: go autoimport

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

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
This change implements async log retrievals via feeding logs in channels, instead of returning slices. This is a first step to implement #15063.

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
RPC methods `eth_getHeaderBy*` returned a size value which was meant for internal
processes. Please instead use `size` field returned by `eth_getBlockBy*` if you're interested
in the RLP encoded storage size of the block.

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
This change splits up the multiple API functions / namespaces currently defined in the eth package into different per-namespace files.

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
rm error when marshal block to rpc type allen

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Felix Lange <fjl@twurst.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* internal/ethapi: testBackend reuse the same db

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

* internal/ethapi: implment GetTransaction

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

* internal/ethapi: implement GetReceipts

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

* internal/ethapi: insert receipts and setup txlookup

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

* internal/ethapi: add simple success tx receipt test

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

* internal/ethapi: add case create contract

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

* internal/ethapi: add contract call receipt

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

* internal/ethapi: add tx notfound

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

* internal/ethapi: add dynamic fee testcase

* internal/ethapi: add accessList receipt

* internal/ethapi: no need to insert receipt chain, no error

* internal/ethapi: use HeaderByHash instead

* internal/ethapi: add one more case

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
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.

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
eth: make StorageRangeAt take a block hash or number

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
…mplementation (#27310)

Deserialize hex keys early to shortcut on invalid input, and re-use the account storageTrie for each proof for each proof in the account, preventing repeated deep-copying of the trie.

Closes #27308

 --------

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Drop the notions of uncles, and disables activities while syncing

-  Disable activities (e.g. generate pending state) while node is syncing,
-  Disable empty block submission (but empty block is still kept for payload building),
-  Drop uncle notion since (ethash is already deprecated)

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
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.

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
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.

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* core/state: remove cached snap data if reset occurs

* core/state: address comment from peter

* core/state: skip revert in case data is nil

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* core: crypto: implement BLOBHASH and pointEval precompile

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

* core/vm: fix review comments

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* 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

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
… (#27323)

* core/state/snapshot, core/types, eth: move account definition to type

* core, eth: revert snapshot Account API change

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
This fix a minor implementation issue with the newly introduced isGapped function and it is described in ticket: ethereum/go-ethereum#27401

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
…ols) (#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

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
rjl493456442 and others added 29 commits September 1, 2023 12:44
* core/state: clean up

* all: add block number infomration to statedb

* core, trie: rename blockNumber to block

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* core/types: add data gas fields in Receipt

* core/types: use BlobGas method of tx

* core: fix test

* core/types: fix receipt tests, add data gas used field test

---------

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* 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>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* eth: excessDataGas -> excessBlobGas

* consensus: data gas -> blob gas

* core: data gas -> blob gas

* params: data gas -> blob gas

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
* 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>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
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()

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
…(#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.

Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
Signed-off-by: Darioush Jalali <darioush.jalali@avalabs.org>
… (#27323)

* core/state/snapshot, core/types, eth: move account definition to type

* core, eth: revert snapshot Account API change
@darioush darioush closed this Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Status: Backlog 🗄
Development

Successfully merging this pull request may close these issues.

None yet