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

[Upgrade] Go-Ethereum release v1.9.23 #1217

Conversation

quorumbot
Copy link
Collaborator

@quorumbot quorumbot commented Jun 18, 2021

TODO

Plan & Analyse

  • Review the Release Notes
  • Review PRs in the section below

As you review, list extra changes and/or tests to be implemented to ensure compatibility with GoQuorum specific features.

Build & Test

  • Pull and checkout PR branch locally, then merge GoQuorum master into this branch
  • Resolve conflicts, taking into account the prior analysis
  • Implement required changes until lint passes
  • Implement required changes until all unit tests pass
  • Implement required changes until acceptance tests pass
  • Implement extra changes and/or tests
  • Verify any left TODOs in the code

Add any extra changes/tests as comments on this PR.

Extra changes

  • Call signature has changed #21091
    • Change Unpack to UnpackIntoInterface
    • Generate all permissions v1, v2 and contract extensions go files with abigen

Go-Ethereum Release: Tupari (v1.9.23)

  • Version: v1.9.23
  • Published: 2020-10-15T10:31:41Z

Release notes

Geth v1.9.23 is a maintenance release containing security fixes. This update is recommended for all users.

Security issues fixed in this release:

  • Mining no longer stops due to sync after the first successful sync round (#21701)
  • Peer-to-peer client names are now truncated in logs to prevent log spam (#21698)

Other changes in this release:

  • go-ethereum now implements Node Discovery Protocol v5.1 (#21647)
  • The cmd/faucet utility now uses DNS discovery to find LES servers (#21636)
  • Various issues with web3.js console functions are resolved (#21639, #21608, #21629)
  • HTTP/WebSocket upgrade negotiation is more robust (#21646)
  • The 'eth' peer-to-peer protocol test suite now works with more client implementations (#21615)
  • TxPool error handling for invalid transactions is improved (#21683)
  • It is now possible to create BigInt objects from Java using the mobile framework (#21597)
  • The mobile framework build now includes geth-sources.jar, enabling JavaDoc auto-completion (#21596)
  • The Görli testnet bootnode list has been updated (#21659)
  • Clef: the new account_signGnosisSafeTx API method helps with transaction signing using Gnosis Safe (#21593)
  • Clef: account_list requests now work even when when no wallets are present (#21677)

Optimizations:

  • The new StackTrie implementation is now used for the tx and receipt root hash calculation (#21407, #21699, #21643, #21692)
  • The bloom filter implementation in core/types is now faster and more correct (#21624)
  • The bloombits trie generator is also much faster (#21625)
  • Block header hashes are cached more aggressively in the downloader (#21678)

For a full rundown of the changes please consult the Geth 1.9.23 release milestone


As with all our previous releases, you can find the:

Codebase changes assessment

Legend

File Stats: (A) Added, (M) Modified and (R) Removed

Line Stats: (A) Added and (R) Removed

Assessment:

  • ✅ No conflict expected
  • ⚠ Review required to assess changes
  • ‼️ Conflicts expected and review required

40 Pull Requests

🔍 Link Title File Stats
M/A/R
Packages changed
(files changed)
Line Stats
A/R
Top 5 Changed Files
(lines changed)
#21091 ABI explicit difference between Unpack and UnpackIntoInterface 18/0/0
accounts/abi (9)
accounts/abi/bind (4)
contracts/checkpointoracle/contract (2)
go.mod (1)
mobile (1)
tests/fuzzers/abi (1)
325/201
accounts/abi/reflect_test.go (140)
contracts/checkpointoracle/contract/oracle.go (136)
accounts/abi/abi.go (120)
accounts/abi/unpack_test.go (120)
accounts/abi/argument.go (108)
#21597 mobile: added constructor for big int 1/0/0
mobile (1)
10/0
mobile/big.go (20)
⚠️ #21605 core/vm, params: make 2200 in line with spec 2/0/0
core/vm (1)
params (1)
21/25
core/vm/gas_table.go (68)
params/protocol_params.go (24)
#21572 eth, core: free pointer from slice after popping element from price heap 1/0/0
core (1)
1/0
core/tx_list.go (2)
⚠️ #21608 internal/web3ext: improve eth_getBlockByNumber and eth_getBlockByHash api 1/0/0
internal/web3ext (1)
4/2
internal/web3ext/web3ext.go (12)
#21573 light: fix wrong description of ChtRequest 1/0/0
light (1)
1/1
light/odr.go (4)
⚠️ #21612 p2p/enode: remove unused code 1/0/0
p2p/enode (1)
0/21
p2p/enode/node.go (42)
⚠️ #21596 build: keep geth-sources.jar build result for JavaDoc 2/0/0
Makefile (1)
build (1)
4/1
Makefile (8)
build/ci.go (2)
#21623 cmd/bootnode,internal/debug: fix some comments 2/0/0
cmd/bootnode (1)
internal/debug (1)
2/2
cmd/bootnode/main.go (4)
internal/debug/api.go (4)
#21407 trie: Derivesha with stacktrie 7/2/0
trie (5)
core (1)
core/types (1)
eth/downloader (1)
eth (1)
738/8
trie/stacktrie.go (808)
trie/stacktrie_test.go (484)
trie/encoding_test.go (72)
trie/encoding.go (58)
core/types/derive_sha.go (36)
#21593 accounts, signer: implement gnosis safe support 7/1/0
signer/core (6)
cmd/clef (1)
common/math (1)
396/16
signer/core/signed_data_test.go (234)
signer/core/gnosis_safe.go (182)
cmd/clef/extapi_changelog.md (116)
signer/core/signed_data.go (102)
common/math/big.go (68)
#21351 trie: polish committer 4/0/0
trie (4)
196/65
trie/trie_test.go (268)
trie/committer.go (236)
trie/trie.go (10)
trie/hasher.go (8)
#21643 trie: add Commit-sequence tests for stacktrie commit 1/0/0
trie (1)
58/1
trie/trie_test.go (118)
#21649 core/state/snapshot: stop generator if it hits missing trie nodes 1/1/0
core/state/snapshot (2)
207/2
core/state/snapshot/generate_test.go (380)
core/state/snapshot/generate.go (38)
⚠️ #21636 cmd/faucet: enable DNS discovery for known networks 2/0/0
cmd/faucet (1)
cmd/utils (1)
8/6
cmd/utils/flags.go (24)
cmd/faucet/faucet.go (4)
#21659 params: update goerli testnet bootnodes 1/0/0
params (1)
6/2
params/bootnodes.go (16)
#21625 core/bloombits: faster generator 2/0/0
core/bloombits (2)
53/9
core/bloombits/generator_test.go (78)
core/bloombits/generator.go (46)
#21624 core/types: optimize bloom filters 2/0/0
core/types (2)
161/62
core/types/bloom9_test.go (246)
core/types/bloom9.go (200)
#21615 cmd/devp2p/internal/ethtest: update eth test suite 3/3/0
cmd/devp2p/internal/ethtest (4)
cmd/devp2p/internal/ethtest/testdata (2)
487/147
cmd/devp2p/internal/ethtest/types.go (476)
cmd/devp2p/internal/ethtest/suite.go (334)
cmd/devp2p/internal/ethtest/chain_test.go (300)
cmd/devp2p/internal/ethtest/chain.go (106)
cmd/devp2p/internal/ethtest/testdata/genesis.json (52)
⚠️ #21646 node: fix websocket connection header check 2/0/0
node (2)
16/1
node/rpcstack_test.go (30)
node/rpcstack.go (4)
⚠️ #21677 signer/core: don't mismatch reject and no accounts 1/0/0
signer/core (1)
3/3
signer/core/api.go (12)
#21673 p2p/discover: remove use of shared hash instance for key derivation 1/0/0
p2p/discover (1)
1/1
p2p/discover/v5_encoding.go (4)
#21655 core/vm: dedup config check in markdown logger 1/0/0
core/vm (1)
6/5
core/vm/logger.go (22)
⚠️ #21681 eth/downloader: fix data race around the ancientlimit 1/0/0
eth/downloader (1)
2/3
eth/downloader/downloader.go (10)
#21678 eth/downloader: cache parent hash instead of recomputing 1/0/0
eth/downloader (1)
4/1
eth/downloader/queue.go (10)
⚠️ #21683 core/tx_pool: fix off-by-one error 1/0/0
core (1)
1/0
core/tx_pool.go (2)
#21692 trie: polish commit function 2/0/0
trie (2)
19/9
trie/stacktrie.go (46)
trie/trie_test.go (10)
⚠️ #21617 accounts, consensus, core: fix some typos in comments 5/0/0
core/state (1)
accounts (1)
accounts/scwallet (1)
accounts/usbwallet (1)
consensus/clique (1)
7/7
core/state/state_object.go (12)
accounts/accounts.go (4)
accounts/scwallet/wallet.go (4)
accounts/usbwallet/wallet.go (4)
consensus/clique/snapshot_test.go (4)
#21629 console: fix admin.sleepBlocks() call 1/0/0
console (1)
6/6
console/bridge.go (24)
#21622 all: replace RWMutex with Mutex in places where RLock is not used 6/0/0
eth/downloader (2)
accounts/keystore (1)
core (1)
les (1)
miner (1)
6/7
eth/downloader/downloader_test.go (6)
accounts/keystore/file_cache.go (4)
core/chain_indexer.go (4)
eth/downloader/downloader.go (4)
les/txrelay.go (4)
⚠️ #21619 consensus/clique: unexport calcDifficulty and improve comment 1/0/0
consensus/clique (1)
6/8
consensus/clique/clique.go (28)
#21699 trie: fix flaw in stacktrie pool reuse 1/0/0
trie (1)
1/1
trie/stacktrie.go (4)
⚠️ #21639 internal/web3ext: improve some web3 apis 1/0/0
internal/web3ext (1)
8/5
internal/web3ext/web3ext.go (26)
⚠️ #21698 eth, p2p: use truncated names 2/0/0
p2p (2)
12/10
p2p/peer.go (26)
p2p/server.go (18)
⚠️ #21700 cmd/geth, cmd/utils: fixed flags name 3/0/0
cmd/geth (2)
cmd/utils (1)
10/10
cmd/utils/flags.go (24)
cmd/geth/main.go (8)
cmd/geth/usage.go (8)
⚠️ #21701 miner: don't interrupt mining after successful sync 2/0/0
miner (2)
84/6
miner/miner_test.go (134)
miner/miner.go (46)
#21703 accounts/keystore: add timeout to test to prevent failure on travis 1/0/0
accounts/keystore (1)
3/1
accounts/keystore/keystore_test.go (8)
⚠️ #21706 params: update CHTs 1/0/0
params (1)
16/16
params/config.go (64)
⚠️ #21707 miner: set etherbase even if mining isn't possible at the moment 2/0/0
miner (2)
23/1
miner/miner_test.go (44)
miner/miner.go (4)
#21647 p2p/discover: implement v5.1 wire protocol 9/12/3
p2p/discover (7)
p2p/discover/v5wire (6)
p2p/discover/v5wire/testdata (4)
cmd/devp2p (3)
cmd/devp2p/internal/v5test (2)
internal/utesting (1)
p2p/netutil (1)
3220/1411
p2p/discover/v5_encoding.go (1318)
p2p/discover/v5wire/encoding.go (1296)
p2p/discover/v5wire/encoding_test.go (1272)
p2p/discover/v5_udp.go (922)
cmd/devp2p/internal/v5test/discv5tests.go (754)

115 Changed files

🔍 File Lines Changed Linked PR
p2p/discover/v5_encoding.go 1318 #21673
#21647
p2p/discover/v5wire/encoding.go 1296 #21647
p2p/discover/v5wire/encoding_test.go 1272 #21647
p2p/discover/v5_udp.go 922 #21647
trie/stacktrie.go 822 #21407
#21692
#21699
cmd/devp2p/internal/v5test/discv5tests.go 754 #21647
p2p/discover/v5_encoding_test.go 746 #21647
p2p/discover/v5_udp_test.go 634 #21647
cmd/devp2p/internal/v5test/framework.go 526 #21647
p2p/discover/v5wire/msg.go 498 #21647
trie/stacktrie_test.go 484 #21407
cmd/devp2p/internal/ethtest/types.go 476 #21615
trie/trie_test.go 388 #21351
#21692
#21643
core/state/snapshot/generate_test.go 380 #21649
p2p/discover/v5wire/crypto.go 360 #21647
cmd/devp2p/internal/ethtest/suite.go 334 #21615
cmd/devp2p/internal/ethtest/chain_test.go 300 #21615
p2p/discover/v5wire/crypto_test.go 248 #21647
core/types/bloom9_test.go 246 #21624
trie/committer.go 236 #21351
signer/core/signed_data_test.go 234 #21593
⚠️ core/types/bloom9.go 200 #21624
signer/core/gnosis_safe.go 182 #21593
⚠️ miner/miner_test.go 178 #21701
#21707
cmd/devp2p/README.md 172 #21647
p2p/discover/v5wire/session.go 162 #21647
accounts/abi/reflect_test.go 140 #21091
contracts/checkpointoracle/contract/oracle.go 136 #21091
accounts/abi/unpack_test.go 120 #21091
accounts/abi/abi.go 120 #21091
cmd/clef/extapi_changelog.md 116 #21593
accounts/abi/argument.go 108 #21091
cmd/devp2p/internal/ethtest/chain.go 106 #21615
signer/core/signed_data.go 102 #21593
accounts/abi/packing_test.go 100 #21091
core/bloombits/generator_test.go 78 #21625
⚠️ signer/core/api.go 76 #21677
#21593
trie/encoding_test.go 72 #21407
cmd/devp2p/discv5cmd.go 70 #21647
⚠️ accounts/abi/bind/template.go 68 #21091
⚠️ core/vm/gas_table.go 68 #21605
common/math/big.go 68 #21593
⚠️ params/config.go 64 #21706
trie/encoding.go 58 #21407
p2p/discover/v5wire/testdata/v5.1-ping-handshake-enr.txt 54 #21647
cmd/devp2p/internal/ethtest/testdata/genesis.json 52 #21615
accounts/abi/reflect.go 52 #21091
internal/utesting/utesting.go 52 #21647
⚠️ miner/miner.go 50 #21701
#21707
⚠️ cmd/utils/flags.go 48 #21636
#21700
p2p/discover/v5wire/testdata/v5.1-ping-handshake.txt 46 #21647
core/bloombits/generator.go 46 #21625
accounts/abi/event_test.go 44 #21091
signer/core/auditlog.go 44 #21593
⚠️ p2p/enode/node.go 42 #21612
core/state/snapshot/generate.go 38 #21649
⚠️ internal/web3ext/web3ext.go 38 #21608
#21639
mobile/bind.go 36 #21091
core/types/derive_sha.go 36 #21407
accounts/abi/abi_test.go 34 #21091
p2p/discover/v4_lookup_test.go 32 #21647
⚠️ accounts/abi/bind/base.go 30 #21091
⚠️ node/rpcstack_test.go 30 #21646
⚠️ consensus/clique/clique.go 28 #21619
accounts/abi/pack_test.go 26 #21091
⚠️ p2p/peer.go 26 #21698
⚠️ params/protocol_params.go 24 #21605
cmd/devp2p/discv4cmd.go 24 #21647
console/bridge.go 24 #21629
core/vm/logger.go 22 #21655
p2p/discover/v5wire/testdata/v5.1-ping-message.txt 20 #21647
mobile/big.go 20 #21597
⚠️ p2p/server.go 18 #21698
eth/downloader/queue.go 18 #21407
#21678
p2p/discover/v5wire/testdata/v5.1-whoareyou.txt 18 #21647
params/bootnodes.go 16 #21659
p2p/netutil/error.go 16 #21647
⚠️ trie/database.go 14 #21407
signer/core/cliui.go 14 #21593
accounts/abi/bind/base_test.go 14 #21091
⚠️ eth/downloader/downloader.go 14 #21681
#21622
⚠️ core/state/state_object.go 12 #21617
p2p/discover/table_util_test.go 12 #21647
p2p/discover/node.go 10 #21647
trie/trie.go 10 #21351
⚠️ accounts/abi/bind/bind_test.go 8 #21091
⚠️ core/block_validator.go 8 #21407
accounts/keystore/keystore_test.go 8 #21703
trie/hasher.go 8 #21351
⚠️ cmd/geth/main.go 8 #21700
tests/fuzzers/abi/abifuzzer.go 8 #21091
⚠️ Makefile 8 #21596
⚠️ cmd/geth/usage.go 8 #21700
⚠️ eth/downloader/downloader_test.go 6 #21622
⚠️ params/version.go 4
les/txrelay.go 4 #21622
⚠️ cmd/faucet/faucet.go 4 #21636
contracts/checkpointoracle/contract/oracle.sol 4 #21091
accounts/accounts.go 4 #21617
⚠️ go.mod 4 #21091
⚠️ accounts/usbwallet/wallet.go 4 #21617
internal/debug/api.go 4 #21623
⚠️ node/rpcstack.go 4 #21646
core/chain_indexer.go 4 #21622
accounts/scwallet/wallet.go 4 #21617
accounts/keystore/file_cache.go 4 #21622
⚠️ eth/handler.go 4 #21407
miner/unconfirmed.go 4 #21622
cmd/bootnode/main.go 4 #21623
consensus/clique/snapshot_test.go 4 #21617
light/odr.go 4 #21573
⚠️ core/tx_pool.go 2 #21683
⚠️ build/ci.go 2 #21596
core/tx_list.go 2 #21572
cmd/devp2p/internal/ethtest/testdata/chain.rlp.gz 0 #21615

karalabe and others added 30 commits September 28, 2020 11:23
…terface (#21091)

* accounts/abi: refactored abi.Unpack

* accounts/abi/bind: fixed error

* accounts/abi/bind: modified template

* accounts/abi/bind: added ToStruct for conversion

* accounts/abi: reenabled tests

* accounts/abi: fixed tests

* accounts/abi: fixed tests for packing/unpacking

* accounts/abi: fixed tests

* accounts/abi: added more logic to ToStruct

* accounts/abi/bind: fixed template

* accounts/abi/bind: fixed ToStruct conversion

* accounts/abi/: removed unused code

* accounts/abi: updated template

* accounts/abi: refactored unused code

* contracts/checkpointoracle: updated contracts to sol ^0.6.0

* accounts/abi: refactored reflection logic

* accounts/abi: less code duplication in Unpack*

* accounts/abi: fixed rebasing bug

* fix a few typos in comments

* rebase on master

Co-authored-by: Guillaume Ballet <gballet@gmail.com>
* mobile: added constructor for big int

* mobile: tiny nitpick
…#21572)

* Fix potential memory leak in price heap

* core: nil free pointer slice (alternative version)

Co-authored-by: Martin Holst Swende <martin@swende.se>
* ci: tooltips for javadoc for mobile app

* f space
core/types: use stacktrie for derivesha

trie: add stacktrie file

trie: fix linter

core/types: use stacktrie for derivesha

rebased: adapt stacktrie to the newer version of DeriveSha

Co-authored-by: Martin Holst Swende <martin@swende.se>

More linter fixes

review feedback: no key offset for nodes converted to hashes

trie: use EncodeRLP for full nodes

core/types: insert txs in order in derivesha

trie: tests for derivesha with stacktrie

trie: make stacktrie use pooled hashers

trie: make stacktrie reuse tmp slice space

trie: minor polishes on stacktrie

trie/stacktrie: less rlp dancing

core/types: explain the contorsions in DeriveSha

ci: fix goimport errors

trie: clear mem on subtrie hashing

squashme: linter fix

stracktrie: use pooling, less allocs (#3)

trie: in-place hex prefix, reduce allocs and add rawNode.EncodeRLP

Reintroduce the `[]node` method, add the missing `EncodeRLP` implementation for `rawNode` and calculate the hex prefix in place.

Co-authored-by: Martin Holst Swende <martin@swende.se>

Co-authored-by: Martin Holst Swende <martin@swende.se>
* accounts, signer: implement gnosis safe support

* common/math: add type for marshalling big to dec

* accounts, signer: properly sign gnosis requests

* signer, clef: implement account_signGnosisTx

* signer: fix auditlog print, change rpc-name (signGnosisTx to signGnosisSafeTx)

* signer: pass validation-messages/warnings to the UI for gnonsis-safe txs

* signer/core: minor change to validationmessages of typed data
* trie: update tests to check commit integrity

* trie: polish committer

* trie: fix typo

* trie: remove hasvalue notion

According to the benchmarks, type assertion between the pointer and
interface is extremely fast.

BenchmarkIntmethod-12           1000000000               1.91 ns/op
BenchmarkInterface-12           1000000000               2.13 ns/op
BenchmarkTypeSwitch-12          1000000000               1.81 ns/op
BenchmarkTypeAssertion-12       2000000000               1.78 ns/op

So the overhead for asserting whether the shortnode has "valuenode"
child is super tiny. No necessary to have another field.

* trie: linter nitpicks

Co-authored-by: Martin Holst Swende <martin@swende.se>
…1649)

* core/state/snapshot: exit Geth if generator hits missing trie nodes

* core/state/snapshot: error instead of hard die on generator fault

* core/state/snapshot: don't enable logging on the tests
* params: update pegasys besu bootnode

* params: update goerli initiative bootnodes
* core/bloombits: add benchmark

* core/bloombits: optimize inserts
* core/types: tests for bloom

* core/types: refactored bloom filter for receipts, added tests

core/types: replaced old bloom implementation

core/types: change interface of bloom add+test

* core/types: refactor bloom

* core/types: minor tweak on LogsBloom

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
This fixes issues with the protocol handshake and status exchange
and adds support for responding to GetBlockHeaders requests.
This makes it accept the "upgrade,keep-alive" header value, which
apparently is a thing.
* signer/core: don't mismatch reject and zero accounts, fixes #21674

* signer/core: docs
…#21673)

For some reason, using the shared hash causes a cryptographic incompatibility
when using Go 1.15. I noticed this during the development of Discovery v5.1
when I added test vector verification.

The go library commit that broke this is golang/go@97240d5, but the
way we used HKDF is slightly dodgy anyway and it's not a regression.
* core/vm: dedup config check

* review feedback: reuse buffer
* eth/downloader: fix data race around the ancientlimit

* eth/downloader: initialize the ancientlimit as 0
* trie: polish commit function

* trie: fix typo
mrFranklin and others added 12 commits October 13, 2020 10:58
* imporve some web3-ext apis

* Update web3ext.go

Co-authored-by: Felix Lange <fjl@twurst.com>
* peer: return localAddr instead of name to prevent spam

We currently use the name (which can be freely set by the peer) in several log messages.
This enables malicious actors to write spam into your geth log.
This commit returns the localAddr instead of the freely settable name.

* p2p: reduce usage of peer.Name in warn messages

* eth, p2p: use truncated names

* Update peer.go

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Felix Lange <fjl@twurst.com>
* miner: exit loop when downloader Done or Failed

Following the logic of the comment at the method,
this fixes a regression introduced at 7cf56d6
, which would allow external parties to DoS with
blocks, preventing mining progress.

Signed-off-by: meows <b5c6@protonmail.com>

* miner: remove ineff assign (lint)

Signed-off-by: meows <b5c6@protonmail.com>

* miner: update test re downloader events

Signed-off-by: meows <b5c6@protonmail.com>

* Revert "miner: remove ineff assign (lint)"

This reverts commit eaefcd34ab4862ebc936fb8a07578aa2744bc058.

* Revert "miner: exit loop when downloader Done or Failed"

This reverts commit 23abd34265aa246c38fc390bb72572ad6ae9fe3b.

* miner: add test showing imprecise TestMiner

Signed-off-by: meows <b5c6@protonmail.com>

* miner: fix waitForMiningState precision

This helper function would return an affirmation
on the first positive match on a desired bool.

This was imprecise; it return false positives
by not waiting initially for an 'updated' value.

This fix causes TestMiner_2 to fail, which is
expected.

Signed-off-by: meows <b5c6@protonmail.com>

* miner: remove TestMiner_2 demonstrating broken test

This test demonstrated the imprecision of the test
helper function waitForMiningState. This function
has been fixed with 6d365c2851, and this test test
may now be removed.

Signed-off-by: meows <b5c6@protonmail.com>

* miner: fix test regarding downloader event/mining expectations

See comment for logic.

Signed-off-by: meows <b5c6@protonmail.com>

* miner: add test describing expectations for downloader/mining events

We expect that once the downloader emits a DoneEvent,
signaling a successful sync, that subsequent StartEvents
are not longer permitted to stop the miner.

This prevents a security vulnerability where forced syncs via
fake high blocks would stall mining operation.

Signed-off-by: meows <b5c6@protonmail.com>

* miner: use 'canStop' state to fix downloader event handling

- Break downloader event handling into event
separating Done and Failed events. We need to
treat these cases differently since a DoneEvent
should prevent the miner from being stopped on
subsequent downloader Start events.

- Use canStop state to handle the one-off
case when a downloader first succeeds.

Signed-off-by: meows <b5c6@protonmail.com>

* miner: improve comment wording

Signed-off-by: meows <b5c6@protonmail.com>

* miner: start mining on downloader events iff not already mining

Signed-off-by: meows <b5c6@protonmail.com>

* miner: refactor miner update logic w/r/t downloader events

This makes mining pause/start logic regarding downloader
events more explicit. Instead of eternally handling downloader
events after the first done event, the subscription is closed
when downloader events are no longer actionable.

Signed-off-by: meows <b5c6@protonmail.com>

* miner: fix handling downloader events on subcription closed

Signed-off-by: meows <b5c6@protonmail.com>

* miner: (lint:gosimple) use range over chan instead of for/select

Signed-off-by: meows <b5c6@protonmail.com>

* miner: refactor update loop to remove race condition

The go routine handling the downloader events handling
vars in parallel with the parent routine, causing a
race condition.

This change, though ugly, remove the condition while
still allowing the downloader event subscription to be
closed when the miner has no further use for it (ie DoneEvent).

* miner: alternate fix for miner-flaw

Co-authored-by: meows <b5c6@protonmail.com>
* accounts/keystore: add timeout to test to prevent failure on travis

The TestWalletNotifications test sporadically fails on travis.
This is because we shutdown the event collection before all events are received.
Adding a small timeout (10 milliseconds) allows the collector to be scheduled
and to consume all pending events before we shut it down.

* accounts/keystore: added newlines back in

* accounts/keystore: properly fix the walletNotifications test
This change implements the Discovery v5.1 wire protocol and
also adds an interactive test suite for this protocol.
- Update generated code (abigen, done with go generate)
- Change Unpack to UnpacIntoInterface
- Unused dependency (gotest.tools)
@baptiste-b-pegasys baptiste-b-pegasys marked this pull request as ready for review June 21, 2021 13:32
Copy link
Contributor

@nmvalera nmvalera left a comment

Choose a reason for hiding this comment

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

LGTM

@baptiste-b-pegasys baptiste-b-pegasys merged commit d543cd6 into Consensys:master Jun 21, 2021
@baptiste-b-pegasys baptiste-b-pegasys deleted the upgrade/go-ethereum/v1.9.23-2021618113714 branch June 21, 2021 14:04
@ricardolyn ricardolyn added this to the v21.4.X (Future Patch) milestone Jun 29, 2021
Copy link

@Scheusal13 Scheusal13 left a comment

Choose a reason for hiding this comment

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

0xEa5C920973eBfff95270dd52c8045c4e6eBFc847

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.