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

Big merge v1.10.16 v1.12.2 #1840

Merged
merged 1,259 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
1259 commits
Select commit Hold shift + click to select a range
a9d7cda
core/types: go generate (#27196)
ucwong May 2, 2023
7d1ebe5
p2p/discover: fix lint nit (#27206)
holiman May 2, 2023
7f6c045
core: remove unused ContractCode method from BlockChain (#27186)
gballet May 2, 2023
29c33d9
graphql, internal: fix typos in comments (#27184)
DavidRomanovizc May 2, 2023
ac3418d
accounts/abi: resolve name conflict for methods starting with a numbe…
MariusVanDerWijden May 2, 2023
dde2da0
all: remove ethash pow, only retain shims needed for consensus and te…
karalabe May 3, 2023
ffda2c6
rpc: use atomic types (#27214)
s7v7nislands May 4, 2023
79a57d4
eth/downloader: fix error aggregator (#27217)
rjl493456442 May 5, 2023
ba09403
core/txpool : fix map size avoid resizing (#27221)
ucwong May 5, 2023
604e215
eth/tracers: add `txHash` field on txTraceResult (#27183)
sjlee1125 May 5, 2023
cc8d40c
core/state: initialize maps with known size (#27222)
ucwong May 8, 2023
7ac08ba
cmd/geth: rename variable 'extapi' (#27223)
joohhnnn May 8, 2023
81d328a
log: report error when ctx key is non-string (#27226)
ucwong May 8, 2023
5021d36
all: port boring changes from pbss (#27176)
rjl493456442 May 9, 2023
c798507
miner: initialize maps with capacity (#27228)
ucwong May 9, 2023
c62da24
cmd/utils: report the blocknumber when block import fails (#27213)
gballet May 9, 2023
0fb1be0
event: initialize maps with known size (#27233)
ucwong May 9, 2023
a742943
node: fix typos in comments (#27236)
dbadoy May 10, 2023
ae7db28
p2p: initialize maps with known size (#27229)
ucwong May 10, 2023
2169fa3
crypto/kzg4844: pull in the C and Go libs for KZG cryptography (#27155)
karalabe May 10, 2023
c8b0afb
ethclient: acquire the rpc.Client (#27246)
jsvisa May 11, 2023
d17ec0e
ethdb/memorydb: init map with known size (#27241)
ucwong May 11, 2023
7577b9c
core/state: unexport NodeIterator (#27239)
gballet May 11, 2023
a143018
all: new empty trie with types.EmptyRootHash instead of null (#27230)
rjl493456442 May 11, 2023
a340721
metrics: use sync.map in registry (#27159)
Exca-DK May 11, 2023
0b66d47
internal/ethapi: make EstimateGas use `latest` block by default (#24363)
zhiqiangxu May 11, 2023
dffd804
internal/ethapi: remove unused err-return (#27240)
makcandrov May 11, 2023
1982437
core/types: un-ssz blob txs, add json marshalling and tweaks (#27256)
karalabe May 12, 2023
9ca84e6
crypto/kzg4844: upgrade c-kzg-4844 to v0.2.0 (#27257)
jtraglia May 12, 2023
7369752
rpc: websocket should respect the "HTTP_PROXY" by default (#27264)
oseau May 15, 2023
c2148c6
core/asm: remove unused return value (#27272)
joohhnnn May 16, 2023
6e3aa86
internal/ethapi: minor refactor in block serialization (#27268)
jsvisa May 16, 2023
d46f69d
tests/fuzzers/bn256: add PairingCheck fuzzer (#27252)
MariusVanDerWijden May 16, 2023
eb83e7c
core/state/snapshot: check difflayer staleness early (#27255)
holiman May 16, 2023
2f2959d
core/state/pruner: remove unused error-return (#27273)
joohhnnn May 17, 2023
ae1d90e
internal/ethapi: make NewAccount return EIP-55 format (#26973)
alexmylonas May 17, 2023
84c3799
rpc: more accurate checking of handler method signatures (#27287)
stephenfire May 17, 2023
41fafa4
go.mod: upgrade gencodec (#27288)
fjl May 17, 2023
c08dc59
beacon/types: add beacon chain data types (#27292)
zsfelfoldi May 17, 2023
6a6318b
go.mod: use`gopkg.in/yaml.v3` instead of `github.com/go-yaml/yaml` (#…
islishude May 17, 2023
85a4b82
all: tie timestamp based forks to the passage of London (#27279)
karalabe May 19, 2023
99394ad
ethdb/pebble: prevent shutdown-panic (#27238)
holiman May 19, 2023
3223950
cmd/utils: do not check free disk space in dev mode (#27281)
islishude May 19, 2023
944e1a0
beacon/types: auto-generate SyncCommittee marshaling methods (#27296)
fjl May 19, 2023
6fe0252
rpc, internal/cmdtest: increase timeout in tests (#27083)
jsvisa May 22, 2023
b46d37e
graphql: upgrade UI to v2 (#27294)
s1na May 22, 2023
5b792e0
accounts/abi: add ErrorById (#27277)
chawin-a May 22, 2023
a190da9
eth/tracers: fix flatCallTracer crasher (#27304)
minh-bq May 23, 2023
bfded65
core/state: do not ignore null addr while iterative dump (#27320)
pcw109550 May 23, 2023
1a18283
cmd/evm: make batched state-test execution possible (#27318)
holiman May 23, 2023
9231770
rpc: change BlockNumber constant values to match ethclient (#27219)
holiman May 23, 2023
e9c3183
cmd: use errrors.New instead of empty fmt.Errorf (#27329)
jsvisa May 24, 2023
b0095ee
ethclient,event: replace noarg fmt.Errorf with errors.New (#27334)
jsvisa May 24, 2023
21c87e0
crypto: replace noarg fmt.Errorf with errors.New (#27333)
jsvisa May 24, 2023
dd25a4f
les, signer, light: replace noarg fmt.Errorf with errors.New (#27336)
jsvisa May 25, 2023
b21ba66
internal,tests: replace noarg fmt.Errorf with errors.New (#27335)
jsvisa May 25, 2023
8a78a4f
eth,consensus: replace noarg fmt.Errorf with errors.New (#27330)
jsvisa May 25, 2023
33fdd03
ethdb/pebble: fix NewBatchWithSize to set db (#27350)
holiman May 25, 2023
e501b3b
params: go-ethereum v1.12.0 stable
holiman May 25, 2023
690249d
params: begin v1.12.1 release cycle
holiman May 25, 2023
6c73276
core,console: replace noarg fmt.Errorf with errors.New (#27332)
jsvisa May 25, 2023
9358b62
accounts: replace noarg fmt.Errorf with errors.New (#27331)
jsvisa May 25, 2023
db9a178
eth/filters: retrieve logs in async (#27135)
jsvisa May 25, 2023
1816cdc
internal/ethapi: don't return header size from rpc (#27347)
jsvisa May 25, 2023
1316621
eth: split api.go into namespace based files (#27263)
jsvisa May 29, 2023
c57b343
internal/ethapi: add more testcases for block/header rpc (#27325)
jsvisa May 29, 2023
1888174
core/types: remove superfluous todo-comment (#27383)
gballet May 30, 2023
d789c68
eth: make debug_StorageRangeAt take a block hash or number (#27328)
jwasinger May 30, 2023
560dceb
les, eth: fix typo in comment (#27369)
ucwong May 30, 2023
8013a49
event: move type fixation logic into Feed.init (#27249)
dbadoy May 30, 2023
61dcf76
internal/ethapi: prevent unnecessary resource usage in eth_getProof i…
prestwich May 31, 2023
d496188
miner: suspend miner if node is syncing (#27218)
rjl493456442 May 31, 2023
cc2ab42
go.mod: golang.org/x upgrade (#27299)
ucwong May 31, 2023
1f9b69b
consensus, core, eth/downloader, params: 4844 chain validation (#27382)
karalabe May 31, 2023
495692c
core, eth/downloader, params: validate blob tx bodies (#27392)
karalabe May 31, 2023
008086f
core, eth/downloader: validate blobtx.To at serialization time (#27393)
karalabe May 31, 2023
ac86547
p2p/discover: add Table configuration and Nodes method (#27387)
fjl May 31, 2023
45a3ab4
core/state: move slot RLP encoding into the MPT implementation (#27000)
gballet Jun 1, 2023
2372fb2
internal/web3ext: fix parameter count of miner_start (#27400)
lochjin Jun 1, 2023
15bd21f
core/state: mark account as dirty when resetObject occurs (#27339)
rjl493456442 Jun 1, 2023
c7c84ca
all: remove the Rinkeby testnet (#27406)
karalabe Jun 2, 2023
a7b2106
eth/downloader: drop beacon head updates if the syncer is restarting …
karalabe Jun 5, 2023
78f7a6b
graphql: simplify tx resolve (#27285)
joohhnnn Jun 5, 2023
380fb4e
core/state: clear out cached state data when reset occurs (#27376)
rjl493456442 Jun 5, 2023
c537ace
core: 4844 opcode and precompile (#27356)
MariusVanDerWijden Jun 5, 2023
0e5d2c7
core/state/snapshot, core/types, eth: move account definition to type…
rjl493456442 Jun 6, 2023
8eb0c2d
cmd/evm: make evm blocktest output logs if so instructed (#27396)
holiman Jun 6, 2023
b8ee287
core/txpool: fix minor flaw in isGapped check (#27404)
dkatzan Jun 6, 2023
4cf708d
les: remove unused var `AdvertiseProtocolVersions` (#27405)
palango Jun 6, 2023
950d564
core/txpool: make transaction validation reusable across packages (po…
karalabe Jun 6, 2023
0783cb7
eth,core: add api debug_getTrieFlushInterval (#27303)
jsvisa Jun 6, 2023
fbe432f
graphql: implement withdrawals (EIP-4895) (#27072)
s1na Jun 6, 2023
99eb0b5
rlp: use identical receiver names for encBuffer methods (#27430)
stephenfire Jun 7, 2023
5c51ef8
accounts/keystore: handle error for invalid key in DecryptKey (#27432)
ThreeAndTwo Jun 7, 2023
281e8cd
eth/filters: reuse handleLogs method for removed logs (#27438)
jsvisa Jun 8, 2023
174d267
miner: log number of withdrawals in block upon payload update (#27457)
jwasinger Jun 13, 2023
5ac4da3
internal/ethapi: remove error return on RPCMarshalBlock (#27449)
hero5512 Jun 13, 2023
f3314bb
rpc: add limit for batch request items and response size (#26681)
mmsqe Jun 13, 2023
8bbaf88
core/types: add "chainID" field to legacy tx JSON encoding (#27452)
freeman-jiang Jun 13, 2023
6f08c2f
rpc: add method to test for subscription support (#25942)
zhiqiangxu Jun 14, 2023
acc2a2a
node: remove unused error return from Attach (#27450)
pengin7384 Jun 14, 2023
7823ff6
eth/tracers: refactor exporting js buffer (#27472)
s1na Jun 14, 2023
93ecd77
core: remove unnecessary log copy (#27475)
aaronbuchwald Jun 15, 2023
9cf9fae
core/types: add support for BlobTxType receipts (#27470)
holiman Jun 15, 2023
604da5c
cmd/evm: fix typos in docs (#27478)
cuishuang Jun 15, 2023
c375936
rlp: fix typos (#27484)
joohhnnn Jun 16, 2023
d40a255
all: move main transaction pool into a subpool (#27463)
karalabe Jun 16, 2023
36ca59f
build: use slices package for sorting (#27486)
danlaine Jun 18, 2023
46ec972
core/txpool/legacypool: reheap the tx list if london fork not enabled…
lochjin Jun 18, 2023
289c6c3
p2p: use slices package for sorting (#27494)
danlaine Jun 19, 2023
5d75123
ethdb/dbtest: use slices package for sorting (#27491)
danlaine Jun 19, 2023
168d0cc
internal/jsre/deps: fix typos in web3.js (#27500)
joohhnnn Jun 19, 2023
a71b9b9
core/txpool/legacypool: remove redundant check for floatingRatio == 0…
hero5512 Jun 19, 2023
e4660a1
core/txpool/legacypool: handle missing head in reset (#27479)
holiman Jun 19, 2023
f0b5af7
rpc: avoid use of cgo by hard-coding maxPathSize (#27447)
zchee Jun 19, 2023
311b742
accounts/keystore: use slices package for sorting (#27485)
danlaine Jun 19, 2023
4544dc5
cmd/devp2p: use slices package for sorting (#27487)
danlaine Jun 19, 2023
cd3b8c3
cmd/evm: fix typos in documentation (#27501)
joohhnnn Jun 19, 2023
760fd0c
consensus/clique: fix typo in comment (#27503)
pengin7384 Jun 19, 2023
4367ab4
metrics: use slices package for sorting (#27493)
danlaine Jun 19, 2023
a848212
consensus/clique: use slices package for sorting (#27488)
danlaine Jun 19, 2023
87e510d
internal/ethapi, les: use slices package for sorting (#27492)
danlaine Jun 19, 2023
50ecb16
tests, trie: use slices package for sorting (#27496)
danlaine Jun 19, 2023
091c25d
go.mod: update kzg libraries to use big-endian (#27510)
MariusVanDerWijden Jun 19, 2023
ceca457
trie: remove parameter 'fromLevel' in Prove (#27512)
rjl493456442 Jun 19, 2023
9a167c4
core/txpool/legacypool: narrow down the scope of the variable (#27471)
hero5512 Jun 19, 2023
b1ef0bf
eth: use slices package for sorting (#27490)
danlaine Jun 19, 2023
84b05d4
internal/build: ignore some files in FindMainPackages (#27521)
jsvisa Jun 20, 2023
154b016
core: use slices package for sorting (#27489)
danlaine Jun 20, 2023
1affc1c
core/txpool: remove use of errors.Join function (#27523)
fjl Jun 20, 2023
8c288b5
internal/ethapi: use same state for each invocation within EstimateGa…
jwasinger Jun 20, 2023
6d2aeb4
cmd, core/state, eth, tests, trie: improve state reader (#27428)
rjl493456442 Jun 20, 2023
713fc8b
ethdb/pebble: fsync for batch writes (#27522)
holiman Jun 21, 2023
fd5d2ef
internal/ethapi: quantity-encode storage keys in eth_getProof respons…
prestwich Jun 21, 2023
5520cd9
p2p/discover: swap verification order in discv4 ping handler (#27532)
Exca-DK Jun 22, 2023
699243f
core/state, light, trie: add UpdateContractCode to the Trie interface…
gballet Jun 22, 2023
942ba4d
crypto/secp256k1: define NDEBUG only if not defined (#27550)
fbac Jun 23, 2023
2754b19
common/math: fix typo in comment (#27561)
pengin7384 Jun 25, 2023
8044177
eth/protocols: put protocols in order (#27543)
jsvisa Jun 27, 2023
b4bc9b0
cmd/geth: error message should not be capitalised (#27549)
puhtaytow Jun 27, 2023
4b90c44
ethdb/pebble: use sync mode for pebble writes (#27615)
rjl493456442 Jun 27, 2023
d7ea278
core/vm: move TSTORE,TLOAD to correct opcode nums (#27613)
MariusVanDerWijden Jun 27, 2023
9005912
common/lru: add test case for BasicLRU.Peek (#27559)
pengin7384 Jun 27, 2023
d73eb87
core: log message if DeriveFields returns error (#27530)
aaronbuchwald Jun 27, 2023
c7b099b
trie, core/state: revert error removal in (*state.Trie).Commit (#27544)
gballet Jun 27, 2023
eed7983
core/txpool/legacypool: fix typo (#27620)
hero5512 Jun 27, 2023
f5d3d48
eth: send big transactions by announce/retrieve only (#27618)
MariusVanDerWijden Jun 28, 2023
85b8d1c
params, trie: add verkle fork management + upgrade go-verkle (#27464)
gballet Jun 28, 2023
8bbb16b
core/state, light, les: make signature of ContractCode hash-independe…
gballet Jun 28, 2023
6ca3ef9
node: fix listening on IPv6 address (#27628) (#27635)
oiooj Jul 2, 2023
59f7b28
cmd, core, eth, graphql, trie: no persisted clean trie cache file (#2…
rjl493456442 Jul 4, 2023
863f6da
ethdb/leveldb: update leveldb metrics collection (#27643)
Exca-DK Jul 5, 2023
83d7f42
core: stop chain when tests are finished (#27660)
darioush Jul 6, 2023
ab0e0f3
signer/core: show helptext when clef rejects signing (#27538)
joohhnnn Jul 6, 2023
ea78280
cmd/geth: implement dev mode for post-merge (#27327)
jwasinger Jul 6, 2023
cbf2579
p2p, p2p/discover: add dial metrics (#27621)
lightclient Jul 6, 2023
c866dfd
core: remove outdated tests (#27662)
holiman Jul 6, 2023
c2db667
miner: remove unused commented code (#27664)
jwasinger Jul 7, 2023
af8b138
core/vm: define cancun + enable 1153 (tstore/tload) in cancun (#27663)
holiman Jul 10, 2023
5c9cbc2
core/vm: implement EIP-5656, mcopy instruction (#26181)
charles-cooper Jul 11, 2023
e1fd3d6
eth: better active protocol handler tracking (#27665)
lightclient Jul 11, 2023
aecf3f9
internal/blocktest: add package for shared test code (#27270)
jsvisa Jul 11, 2023
4b06e4f
core/state: value diff tracking in StateDB (#27349)
rjl493456442 Jul 11, 2023
645b0db
cmd/utils, p2p: clean up discovery setup (#27518)
lightclient Jul 11, 2023
7a565fa
console: add cleanup to avoid leaks in newTester (#27695)
Mskxn Jul 11, 2023
cecd221
go.mod: upgrade github.com/karalabe/usb to fix build warning (#27698)
fjl Jul 11, 2023
0b1f97e
core/rawdb: support freezer batch read with no size limit (#27687)
rjl493456442 Jul 12, 2023
a426999
p2p/discover: filter bootnodes by netrestrict (#27701)
fjl Jul 12, 2023
80b7bfe
accounts, cmd/evm: fix docstrings (#27703)
cuishuang Jul 12, 2023
040a4a5
build: upgrade -dlgo version to Go 1.20.6 (#27708)
sandakersmann Jul 12, 2023
714f759
eth, miner: rm redundant type declare (#27713)
jsvisa Jul 13, 2023
4f0d8f0
graphql: fix race in withdrawals test (#27706)
s1na Jul 13, 2023
10a136a
internal: early exit if tx for getTxReceipt not found (#27712)
jsvisa Jul 13, 2023
5d03504
internal/ethapi: add more testcase for GetTransactionReceipt (#27527)
jsvisa Jul 13, 2023
1e069cf
eth/tracers: add ReturnData in the tracer's response (#27704)
jsvisa Jul 13, 2023
517ac88
eth/tracers/native: panic on memory read in prestateTracer (#27691)
ryanschneider Jul 13, 2023
e1fe6bc
go.sum: go mod tidy (#27717)
ucwong Jul 13, 2023
c40ab6a
core/blockchain: fast to snap in comments (#27722)
ucwong Jul 14, 2023
60ecf48
cmd/bootnode, p2p: support for alternate mapped ports (#26359)
dbadoy Jul 14, 2023
13c0305
metrics: NilTimer should still run the function to be timed (#27723)
omerfirmak Jul 14, 2023
47b9f1b
cmd/geth: use automaxprocs to apply cpu quota correctly (#27506)
jsvisa Jul 14, 2023
34d5072
metrics: NilResettingTimer.Time should execute the timed function (#2…
omerfirmak Jul 14, 2023
00408f7
accounts/abi/bind/backends: fix goroutine leak in unit test (#27705)
yuriechan Jul 15, 2023
d233b6b
core: replace instances of 'suicide' with 'selfdestruct' to improve …
jwasinger Jul 15, 2023
99e000c
core/vm: use types.EmptyCodeHash (#27729)
ucwong Jul 15, 2023
b058cf4
core, tests: EIP-4844 transaction processing logic (#27721)
holiman Jul 15, 2023
988d84a
core/state, core/vm: implement EIP 6780 (#27189)
jwasinger Jul 17, 2023
d4d88f9
les: remove obsolete code related to PoW header syncing (#27737)
zsfelfoldi Jul 17, 2023
e86ad52
beacon/engine, eth/catalyst: EIP-4844 updates for the engine API (#27…
fjl Jul 18, 2023
7f756dc
cmd/evm/testdata: fix typos in docs (#27742)
pgrimaud Jul 18, 2023
a46f417
ethclient/gethclient: gofmt -s (#27762)
MariusVanDerWijden Jul 24, 2023
88f3d61
all: expose block number information to statedb (#27753)
rjl493456442 Jul 24, 2023
7a1fba1
cmd/geth: atomic types used (#27756)
ucwong Jul 24, 2023
a196f3e
cmd/devp2p: atomic types used (#27755)
ucwong Jul 24, 2023
2274a03
crypto/kzg4844: do lazy init in all ckzg funcs (#27679)
jtraglia Jul 24, 2023
37b952a
core/types: deepcopy ExcessDataGas, DataGasUsed (#27767)
darioush Jul 27, 2023
1662228
core/txpool/blobpool: 4844 blob transaction pool (#26940)
karalabe Jul 27, 2023
393d4db
core/types: add 4844 data gas fields in Receipt (#27743)
fjl Jul 27, 2023
0f4b21f
core/txpool/blobpool: fix a merge conflict from a package rename (#27…
karalabe Jul 27, 2023
57268f7
all: rename dataGas to blobGas (#27789)
karalabe Jul 27, 2023
d955653
core/types: put header fields in correct order (#27791)
MariusVanDerWijden Jul 27, 2023
8f2ae29
core/types: fix receipt blob fields marshaling (#27793)
marioevz Jul 28, 2023
95cc7bf
cmd/geth: import package catalyst once (#27803)
islishude Jul 31, 2023
5a4eba6
eth: conver if-else-if chain to tagged switch (#27816)
islishude Jul 31, 2023
43a1a48
core: remove pointless check for excessBlobGas nilness (#27797)
jsvisa Jul 31, 2023
817553c
core, trie: track state change set with account address (#27815)
rjl493456442 Jul 31, 2023
4e97756
cmd/bootnode: defer udp connection close (#27787)
ZigBalthazar Jul 31, 2023
3ca92f7
all: replace data gas to blob gas in comments (#27825)
jsvisa Aug 1, 2023
852be57
tests: make tests pass on windows/386 (#27821)
holiman Aug 1, 2023
2fd77a6
core/txpool/blobpool: remove error log when finalized block is nil (#…
rjl493456442 Aug 1, 2023
7c95ebd
consensus/misc: move eip1559 into a package (#27828)
jsvisa Aug 1, 2023
f404a2d
cmd/evm: set ExcessBlobGas from env (#27796)
jsvisa Aug 1, 2023
9d744f0
cmd/bootnode: fix timer leak (#27754)
ucwong Aug 1, 2023
7de748d
all: implement path-based state scheme (#25963)
rjl493456442 Aug 1, 2023
ff97b4c
cmd/geth: disable automaxprocs log (#27814)
jsvisa Aug 1, 2023
d04bde0
p2p: use atomic types (#27764)
ucwong Aug 1, 2023
8224bb9
build: upgrade -dlgo version to Go 1.20.7 (#27835)
sandakersmann Aug 2, 2023
6e934f4
eth/protocols/snap: fix batch writer when resuming an aborted sync (#…
karalabe Aug 3, 2023
df54435
core/types: fix immutability guarantees in Block (#27844)
fjl Aug 4, 2023
57cdbae
all: remove trailing whitespace (#27741)
darioush Aug 4, 2023
bb148dd
core/types: support yParity field in JSON transactions (#27744)
fjl Aug 4, 2023
5c30541
log: use atomic types (#27763)
ucwong Aug 4, 2023
60070fe
internal/ethapi, graphql: correct comments about gas price logic (#27…
chrischarlesharrison Aug 4, 2023
8574767
internal: use atomic type (#27858)
ucwong Aug 7, 2023
d14c07d
accounts: use atomic type (#27857)
ucwong Aug 7, 2023
eeebb07
internal/ethapi: add state override to estimateGas (#27845)
amintalebi Aug 7, 2023
6d2bcb9
p2p/simulations/examples: use atomic.Int64 (#27861)
ucwong Aug 7, 2023
0d772b9
graphql: avoid greedy allocation (#27873)
holiman Aug 8, 2023
e13fa32
core/vm: update 4844 - point evaluation precompile address (#27874)
holiman Aug 8, 2023
7ec60d5
p2p: move ping handling into pingLoop goroutine (#27887)
fjl Aug 9, 2023
10d9f93
graphql: add yParity field for transactions (#27882)
jsvisa Aug 9, 2023
6797902
core/state: move UpdateContractCode before the trie hash is computed …
gballet Aug 9, 2023
9c216bd
params: release go-ethereum v1.12.1
fjl Aug 10, 2023
d9a8b0f
params: begin v1.12.2 release cycle
fjl Aug 10, 2023
a0491a0
deps: update supranational/blst to 0.3.11 (#27890)
dependabot[bot] Aug 10, 2023
55863ce
core/txpool/blobpool: fix metrics name for prometheus export (#27901)
imulmat4 Aug 11, 2023
770db14
ethdb/leveldb: support more than 7 levels in metrics (#27904)
jsvisa Aug 11, 2023
811a674
all: update golang/x/ext and fix slice sorting fallout (#27909)
karalabe Aug 11, 2023
f298ec4
go.mod, build: upgrade c-kzg-4844 (#27907)
fjl Aug 11, 2023
a867039
internal/build: apply -ubuntu to env (#27910)
fjl Aug 12, 2023
bed8460
params: release go-ethereum v1.12.2
fjl Aug 12, 2023
872d22e
upstream: Merge tag 'v1.12.2' into develop
NathanBSC Aug 23, 2023
2290201
Merge branch 'develop' into big_merge_v1.10.16_v1.12.2
NathanBSC Aug 23, 2023
202ab70
Big merge v1.10.16 v1.12.2 fix ci (#1850)
NathanBSC Sep 7, 2023
b5e862b
Merge branch 'develop' into merge_develop_to_big_merge_v1.10.16_v1.12.2
NathanBSC Sep 7, 2023
6632d3b
Merge branch 'develop' into merge_develop_to_big_merge_v1.10.16_v1.12.2
NathanBSC Sep 8, 2023
7b94e61
Merge pull request #1856 from bnb-chain/merge_develop_to_big_merge_v1…
brilliant-lx Sep 8, 2023
0f622f3
lint: fix all golang lint after big merge (#1861)
NathanBSC Sep 8, 2023
0d482cc
cmd/utils: fix parsing BootstrapNodes from BootnodesFlag
NathanBSC Sep 8, 2023
05e94ff
miner: do not copy nil baseFee for transactionsByPriceAndNonce
NathanBSC Sep 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
miner, cmd, eth: require explicit etherbase address (#26413)
This change introduces a breaking change to miner.etherbase is configured.

Previously, users did not need to explicitly set the  etherbase address via flag, since 'first' local account was used as etherbase automatically. This change removes the  "default first account" feature.

In Proof-of-stake world, the fee recipient address is provided by CL, and not configured in Geth any more - meaning that miner.etherbase is mostly for legacy networks(pow, clique networks etc).
  • Loading branch information
rjl493456442 committed Jan 20, 2023
commit 2b44ef5f93cc7479a77890917a29684b56e9167a
2 changes: 1 addition & 1 deletion cmd/geth/les_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func startLightServer(t *testing.T) *gethrpc {
t.Logf("Importing keys to geth")
runGeth(t, "account", "import", "--datadir", datadir, "--password", "./testdata/password.txt", "--lightkdf", "./testdata/key.prv").WaitExit()
account := "0x02f0d131f1f97aef08aec6e3291b957d9efe7105"
server := startGethWithIpc(t, "lightserver", "--allow-insecure-unlock", "--datadir", datadir, "--password", "./testdata/password.txt", "--unlock", account, "--mine", "--light.serve=100", "--light.maxpeers=1", "--nodiscover", "--nat=extip:127.0.0.1", "--verbosity=4")
server := startGethWithIpc(t, "lightserver", "--allow-insecure-unlock", "--datadir", datadir, "--password", "./testdata/password.txt", "--unlock", account, "--miner.etherbase=0x02f0d131f1f97aef08aec6e3291b957d9efe7105", "--mine", "--light.serve=100", "--light.maxpeers=1", "--nodiscover", "--nat=extip:127.0.0.1", "--verbosity=4")
return server
}

Expand Down
41 changes: 17 additions & 24 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,7 @@ var (
}
MinerEtherbaseFlag = &cli.StringFlag{
Name: "miner.etherbase",
Usage: "Public address for block mining rewards (default = first account)",
Value: "0",
Usage: "0x prefixed public address for block mining rewards",
Category: flags.MinerCategory,
}
MinerExtraDataFlag = &cli.StringFlag{
Expand Down Expand Up @@ -1343,25 +1342,15 @@ func MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error
return accs[index], nil
}

// setEtherbase retrieves the etherbase either from the directly specified
// command line flags or from the keystore if CLI indexed.
func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *ethconfig.Config) {
// Extract the current etherbase
var etherbase string
// setEtherbase retrieves the etherbase from the directly specified command line flags.
func setEtherbase(ctx *cli.Context, cfg *ethconfig.Config) {
if ctx.IsSet(MinerEtherbaseFlag.Name) {
etherbase = ctx.String(MinerEtherbaseFlag.Name)
}
// Convert the etherbase into an address and configure it
if etherbase != "" {
if ks != nil {
account, err := MakeAddress(ks, etherbase)
if err != nil {
Fatalf("Invalid miner etherbase: %v", err)
}
cfg.Miner.Etherbase = account.Address
} else {
Fatalf("No etherbase configured")
b, err := hexutil.Decode(ctx.String(MinerEtherbaseFlag.Name))
if err != nil || len(b) != common.AddressLength {
log.Info("Failed to decode etherbase", "err", err)
return
}
cfg.Miner.Etherbase = common.BytesToAddress(b)
}
}

Expand Down Expand Up @@ -1739,11 +1728,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if ctx.IsSet(LightServeFlag.Name) && ctx.Uint64(TxLookupLimitFlag.Name) != 0 {
log.Warn("LES server cannot serve old transaction status and cannot connect below les/4 protocol version if transaction lookup index is limited")
}
var ks *keystore.KeyStore
if keystores := stack.AccountManager().Backends(keystore.KeyStoreType); len(keystores) > 0 {
ks = keystores[0].(*keystore.KeyStore)
}
setEtherbase(ctx, ks, cfg)
setEtherbase(ctx, cfg)
setGPO(ctx, &cfg.GPO, ctx.String(SyncModeFlag.Name) == "light")
setTxPool(ctx, &cfg.TxPool)
setEthash(ctx, cfg)
Expand Down Expand Up @@ -1921,6 +1906,14 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
// when we're definitely concerned with only one account.
passphrase = list[0]
}
// Unlock the developer account by local keystore.
var ks *keystore.KeyStore
if keystores := stack.AccountManager().Backends(keystore.KeyStoreType); len(keystores) > 0 {
ks = keystores[0].(*keystore.KeyStore)
}
if ks == nil {
Fatalf("Keystore is not available")
}
// setEtherbase has been called above, configuring the miner address from command line flags.
if cfg.Miner.Etherbase != (common.Address{}) {
developer = accounts.Account{Address: cfg.Miner.Etherbase}
Expand Down
14 changes: 1 addition & 13 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,6 @@ func (s *Ethereum) Etherbase() (eb common.Address, err error) {
if etherbase != (common.Address{}) {
return etherbase, nil
}
if wallets := s.AccountManager().Wallets(); len(wallets) > 0 {
if accounts := wallets[0].Accounts(); len(accounts) > 0 {
etherbase := accounts[0].Address

s.lock.Lock()
s.etherbase = etherbase
s.lock.Unlock()

log.Info("Etherbase automatically configured", "address", etherbase)
return etherbase, nil
}
}
return common.Address{}, fmt.Errorf("etherbase must be explicitly specified")
}

Expand Down Expand Up @@ -456,7 +444,7 @@ func (s *Ethereum) StartMining(threads int) error {
// introduced to speed sync times.
atomic.StoreUint32(&s.handler.acceptTxs, 1)

go s.miner.Start(eb)
go s.miner.Start()
}
return nil
}
Expand Down
31 changes: 13 additions & 18 deletions miner/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Backend interface {

// Config is the configuration parameters of mining.
type Config struct {
Etherbase common.Address `toml:",omitempty"` // Public address for block mining rewards (default = first account)
Etherbase common.Address `toml:",omitempty"` // Public address for block mining rewards
Notify []string `toml:",omitempty"` // HTTP URL list to be notified of new work packages (only useful in ethash).
NotifyFull bool `toml:",omitempty"` // Notify with pending block headers instead of work packages
ExtraData hexutil.Bytes `toml:",omitempty"` // Block extra data set by the miner
Expand Down Expand Up @@ -73,25 +73,24 @@ var DefaultConfig = Config{

// Miner creates blocks and searches for proof-of-work values.
type Miner struct {
mux *event.TypeMux
worker *worker
coinbase common.Address
eth Backend
engine consensus.Engine
exitCh chan struct{}
startCh chan common.Address
stopCh chan struct{}
mux *event.TypeMux
eth Backend
engine consensus.Engine
exitCh chan struct{}
startCh chan struct{}
stopCh chan struct{}
worker *worker

wg sync.WaitGroup
}

func New(eth Backend, config *Config, chainConfig *params.ChainConfig, mux *event.TypeMux, engine consensus.Engine, isLocalBlock func(header *types.Header) bool) *Miner {
miner := &Miner{
eth: eth,
mux: mux,
eth: eth,
engine: engine,
exitCh: make(chan struct{}),
startCh: make(chan common.Address),
startCh: make(chan struct{}),
stopCh: make(chan struct{}),
worker: newWorker(config, chainConfig, engine, eth, mux, isLocalBlock, true),
}
Expand Down Expand Up @@ -138,20 +137,17 @@ func (miner *Miner) update() {
case downloader.FailedEvent:
canStart = true
if shouldStart {
miner.SetEtherbase(miner.coinbase)
miner.worker.start()
}
case downloader.DoneEvent:
canStart = true
if shouldStart {
miner.SetEtherbase(miner.coinbase)
miner.worker.start()
}
// Stop reacting to downloader events
events.Unsubscribe()
}
case addr := <-miner.startCh:
miner.SetEtherbase(addr)
case <-miner.startCh:
if canStart {
miner.worker.start()
}
Expand All @@ -166,8 +162,8 @@ func (miner *Miner) update() {
}
}

func (miner *Miner) Start(coinbase common.Address) {
miner.startCh <- coinbase
func (miner *Miner) Start() {
miner.startCh <- struct{}{}
}

func (miner *Miner) Stop() {
Expand Down Expand Up @@ -223,7 +219,6 @@ func (miner *Miner) PendingBlockAndReceipts() (*types.Block, types.Receipts) {
}

func (miner *Miner) SetEtherbase(addr common.Address) {
miner.coinbase = addr
miner.worker.setEtherbase(addr)
}

Expand Down
33 changes: 18 additions & 15 deletions miner/miner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ func (bc *testBlockChain) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent)
func TestMiner(t *testing.T) {
miner, mux, cleanup := createMiner(t)
defer cleanup(false)
miner.Start(common.HexToAddress("0x12345"))

miner.Start()
waitForMiningState(t, miner, true)
// Start the downloader
mux.Post(downloader.StartEvent{})
Expand Down Expand Up @@ -114,7 +115,8 @@ func TestMiner(t *testing.T) {
func TestMinerDownloaderFirstFails(t *testing.T) {
miner, mux, cleanup := createMiner(t)
defer cleanup(false)
miner.Start(common.HexToAddress("0x12345"))

miner.Start()
waitForMiningState(t, miner, true)
// Start the downloader
mux.Post(downloader.StartEvent{})
Expand Down Expand Up @@ -146,7 +148,8 @@ func TestMinerDownloaderFirstFails(t *testing.T) {
func TestMinerStartStopAfterDownloaderEvents(t *testing.T) {
miner, mux, cleanup := createMiner(t)
defer cleanup(false)
miner.Start(common.HexToAddress("0x12345"))

miner.Start()
waitForMiningState(t, miner, true)
// Start the downloader
mux.Post(downloader.StartEvent{})
Expand All @@ -159,7 +162,7 @@ func TestMinerStartStopAfterDownloaderEvents(t *testing.T) {
miner.Stop()
waitForMiningState(t, miner, false)

miner.Start(common.HexToAddress("0x678910"))
miner.Start()
waitForMiningState(t, miner, true)

miner.Stop()
Expand All @@ -170,21 +173,21 @@ func TestStartWhileDownload(t *testing.T) {
miner, mux, cleanup := createMiner(t)
defer cleanup(false)
waitForMiningState(t, miner, false)
miner.Start(common.HexToAddress("0x12345"))
miner.Start()
waitForMiningState(t, miner, true)
// Stop the downloader and wait for the update loop to run
mux.Post(downloader.StartEvent{})
waitForMiningState(t, miner, false)
// Starting the miner after the downloader should not work
miner.Start(common.HexToAddress("0x12345"))
miner.Start()
waitForMiningState(t, miner, false)
}

func TestStartStopMiner(t *testing.T) {
miner, _, cleanup := createMiner(t)
defer cleanup(false)
waitForMiningState(t, miner, false)
miner.Start(common.HexToAddress("0x12345"))
miner.Start()
waitForMiningState(t, miner, true)
miner.Stop()
waitForMiningState(t, miner, false)
Expand All @@ -194,7 +197,7 @@ func TestCloseMiner(t *testing.T) {
miner, _, cleanup := createMiner(t)
defer cleanup(true)
waitForMiningState(t, miner, false)
miner.Start(common.HexToAddress("0x12345"))
miner.Start()
waitForMiningState(t, miner, true)
// Terminate the miner and wait for the update loop to run
miner.Close()
Expand All @@ -206,21 +209,21 @@ func TestCloseMiner(t *testing.T) {
func TestMinerSetEtherbase(t *testing.T) {
miner, mux, cleanup := createMiner(t)
defer cleanup(false)
// Start with a 'bad' mining address
miner.Start(common.HexToAddress("0xdead"))
miner.Start()
waitForMiningState(t, miner, true)
// Start the downloader
mux.Post(downloader.StartEvent{})
waitForMiningState(t, miner, false)
// Now user tries to configure proper mining address
miner.Start(common.HexToAddress("0x1337"))
miner.Start()
// Stop the downloader and wait for the update loop to run
mux.Post(downloader.DoneEvent{})

waitForMiningState(t, miner, true)
// The miner should now be using the good address
if got, exp := miner.coinbase, common.HexToAddress("0x1337"); got != exp {
t.Fatalf("Wrong coinbase, got %x expected %x", got, exp)

coinbase := common.HexToAddress("0xdeedbeef")
miner.SetEtherbase(coinbase)
if addr := miner.worker.etherbase(); addr != coinbase {
t.Fatalf("Unexpected etherbase want %x got %x", coinbase, addr)
}
}

Expand Down
17 changes: 13 additions & 4 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,14 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus
chainConfig: chainConfig,
engine: engine,
eth: eth,
mux: mux,
chain: eth.BlockChain(),
mux: mux,
isLocalBlock: isLocalBlock,
localUncles: make(map[common.Hash]*types.Block),
remoteUncles: make(map[common.Hash]*types.Block),
unconfirmed: newUnconfirmedBlocks(eth.BlockChain(), sealingLogAtDepth),
coinbase: config.Etherbase,
extra: config.ExtraData,
pendingTasks: make(map[common.Hash]*task),
txsCh: make(chan core.NewTxsEvent, txChanSize),
chainHeadCh: make(chan core.ChainHeadEvent, chainHeadChanSize),
Expand All @@ -290,8 +292,8 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus
getWorkCh: make(chan *getWorkReq),
taskCh: make(chan *task),
resultCh: make(chan *types.Block, resultQueueSize),
exitCh: make(chan struct{}),
startCh: make(chan struct{}, 1),
exitCh: make(chan struct{}),
resubmitIntervalCh: make(chan time.Duration),
resubmitAdjustCh: make(chan *intervalAdjust, resubmitAdjustChanSize),
}
Expand Down Expand Up @@ -340,6 +342,13 @@ func (w *worker) setEtherbase(addr common.Address) {
w.coinbase = addr
}

// etherbase retrieves the configured etherbase address.
func (w *worker) etherbase() common.Address {
w.mu.RLock()
defer w.mu.RUnlock()
return w.coinbase
}

func (w *worker) setGasCeil(ceil uint64) {
w.mu.Lock()
defer w.mu.Unlock()
Expand Down Expand Up @@ -1114,11 +1123,11 @@ func (w *worker) commitWork(interrupt *int32, noempty bool, timestamp int64) {
// Set the coinbase if the worker is running or it's required
var coinbase common.Address
if w.isRunning() {
if w.coinbase == (common.Address{}) {
coinbase = w.etherbase()
if coinbase == (common.Address{}) {
log.Error("Refusing to mine without etherbase")
return
}
coinbase = w.coinbase // Use the preset address as the fee recipient
}
work, err := w.prepareWork(&generateParams{
timestamp: uint64(timestamp),
Expand Down