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.13.2 #1116

Closed
wants to merge 10,000 commits into from
Closed

Geth v1.13.2 #1116

wants to merge 10,000 commits into from

Conversation

darioush
Copy link
Collaborator

@darioush darioush commented Mar 6, 2024

Why this should be merged

#1112

How this works

Takes code from upstream

How this was tested

[x] CI
[ ] Testnet

How is this documented

TODO: update deprecated flag

ucwong and others added 30 commits August 1, 2023 14:12
* 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>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
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()
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.
Co-authored-by: Felix Lange <fjl@twurst.com>
Fixes a graphql-dos

---------

Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
Moving the response sending there allows tracking all peer goroutines
in the peer WaitGroup.
Co-authored-by: Felix Lange <fjl@twurst.com>
…(#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.
… (#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.
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>
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.
* 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>
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.
@darioush darioush changed the base branch from geth-v1.12.2-x to master March 6, 2024 22:21
@@ -464,6 +506,17 @@ func (bc *BlockChain) dispatchTxUnindexer() {
return
}
defer sub.Unsubscribe()
log.Info("Initialized transaction unindexer", "limit", txLookupLimit)

// XXX
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why the test fails when I uncomment the below.
Not sure we need to take this change either.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue with unindexer currently, and applying this change can trigger the issue. IMO we should fix this first, gracefully handle the situation and then apply this so we can unindex the txs on startup.

core/blockchain.go Outdated Show resolved Hide resolved
@@ -142,7 +142,32 @@ func (tree *layerTree) cap(root common.Hash, layers int) error {
return err
}
// Replace the entire layer tree with the flat base
tree.layers = map[common.Hash]layer{base.rootHash(): base}
// tree.layers = map[common.Hash]layer{base.rootHash(): base}
// XXX
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems geth adopts a different semantics for commit than what we rely on in blockchain.go
I implemented this version which allows uncommitted layers to remain on top instead of flattening everything.

miner/worker.go Outdated
mu sync.RWMutex // The lock used to protect the coinbase and extra fields
coinbase common.Address
clock *mockable.Clock // Allows us mock the clock for testing
beaconRoot *common.Hash // XXX: this is not set anywhere
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should support setting beaconRoot somehow during block building, but not sure what we would put in it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment in types/block.go

core/state/statedb.go Outdated Show resolved Hide resolved
b.SetCoinbase(common.Address{0x01})
tx, err := types.SignTx(types.NewTransaction(b.TxNonce(addr1), common.Address{0x01}, big.NewInt(10000), params.TxGas, common.Big1, nil), signer, key1)
require.NoError(err)
b.AddTx(tx)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to make these changes since in geth, the roots are different because of the coinbase payment.
Here we just keep on with the empty trie and that doesn't work for the pathdb (doesn't expect repeated roots)

core/rawdb/database.go Outdated Show resolved Hide resolved
core/types/block.go Show resolved Hide resolved
@@ -464,6 +506,17 @@ func (bc *BlockChain) dispatchTxUnindexer() {
return
}
defer sub.Unsubscribe()
log.Info("Initialized transaction unindexer", "limit", txLookupLimit)

// XXX
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an issue with unindexer currently, and applying this change can trigger the issue. IMO we should fix this first, gracefully handle the situation and then apply this so we can unindex the txs on startup.

eth/ethconfig/config.go Show resolved Hide resolved
core/state/statedb.go Outdated Show resolved Hide resolved
core/blockchain.go Outdated Show resolved Hide resolved
metrics/prometheus/prometheus.go Outdated Show resolved Hide resolved
miner/worker.go Outdated
mu sync.RWMutex // The lock used to protect the coinbase and extra fields
coinbase common.Address
clock *mockable.Clock // Allows us mock the clock for testing
beaconRoot *common.Hash // XXX: this is not set anywhere
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comment in types/block.go

@darioush darioush changed the title Geth v.13.2 x Geth v1.13.2 Mar 21, 2024
@darioush
Copy link
Collaborator Author

darioush commented Apr 2, 2024

replaced by #1141

@darioush darioush closed this Apr 2, 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
Development

Successfully merging this pull request may close these issues.