Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

[DRAFT] [WIP] Cancun 1.12.2 #114

Draft
wants to merge 441 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
441 commits
Select commit Hold shift + click to select a range
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)
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)
Jun 19, 2023
5d75123
ethdb/dbtest: use slices package for sorting (#27491)
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)
Jun 19, 2023
4544dc5
cmd/devp2p: use slices package for sorting (#27487)
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)
Jun 19, 2023
a848212
consensus/clique: use slices package for sorting (#27488)
Jun 19, 2023
87e510d
internal/ethapi, les: use slices package for sorting (#27492)
Jun 19, 2023
50ecb16
tests, trie: use slices package for sorting (#27496)
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)
Jun 19, 2023
84b05d4
internal/build: ignore some files in FindMainPackages (#27521)
jsvisa Jun 20, 2023
154b016
core: use slices package for sorting (#27489)
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
e5f7af5
Implement geth-embedded builder API
Ruteri Apr 28, 2022
39d3291
Adjust transactions root computation (#3)
Ruteri Jun 2, 2022
222af77
Adjust logsBloom encoding (#4)
Ruteri Jun 2, 2022
fe9a362
Adjust base fee encoding (#5)
Ruteri Jun 3, 2022
40eb563
Allow resending of the same validator registration (#7)
Ruteri Jun 7, 2022
a9e650a
Adjust value encoding (#9)
Ruteri Jun 10, 2022
ae04316
Show builder pubkey on index page (#10)
Ruteri Jun 10, 2022
b231e2d
Add remote relay connection for getting validator data (#11)
Ruteri Jul 21, 2022
783a3cd
Run builder even if cannot connect to remote relay (#12)
Ruteri Jul 25, 2022
b1ad5e7
Add GasUsed and GasLimit to bid trace (#13)
Ruteri Jul 29, 2022
0de2c8c
Upgrade github.com/btcsuite/btcd (#14)
Ruteri Aug 1, 2022
29d68e9
Fix lint issues (#15)
Ruteri Aug 1, 2022
226df6d
Update README.md (#16)
thINKoor Aug 2, 2022
909d105
Add block build trigger from beacon node api (#17)
avalonche Aug 11, 2022
f7379e1
Addjust profit calculation and use the blocks channel directly
Ruteri Aug 11, 2022
9ef7ab8
Add more explicit builder flags and other QoL improvements (#20)
Ruteri Aug 16, 2022
e75a9a7
Resubmit block build job periodically (#22)
Ruteri Aug 25, 2022
a9ab98f
Implement proposer payment via transaction (#23)
bhakiyakalimuthu Aug 11, 2022
74bffcd
Base block profit on the proposer payment instead of balance differen…
Ruteri Aug 31, 2022
e371e7d
Flashbots change up to v0.3
jparyani Oct 27, 2021
a935bec
Flashbots changes v0.3 to v0.4
bogatyy Oct 27, 2021
ab0e0f3
signer/core: show helptext when clef rejects signing (#27538)
joohhnnn Jul 6, 2023
9db6f04
Flashbots changes v0.4 to v0.5
Ruteri Feb 21, 2022
13959f3
Private Transaction API Sample (v1.10.13)
xcarlo Nov 29, 2021
560ca51
Remove private transactions that are confirmed in blocks
Jan 28, 2022
921249f
Run private transactions e2e tests in ci
Ruteri Feb 24, 2022
9ef2ebc
Discard reverting megabundle blocks and head change interrupted block…
Ruteri Mar 30, 2022
249c5c1
Seal the best block available
Ruteri Jul 29, 2022
19c3ab2
Implement block validation API
Ruteri Aug 17, 2022
2f8e93f
Add timeout to e2e
Ruteri Aug 11, 2022
4596563
Upgrade dependencies
Ruteri Aug 30, 2022
7f7f62a
Only submit blocks that improve profit (#19)
Ruteri Aug 31, 2022
077db7f
Remove megabundles as they are no longer needed (#20)
Ruteri Aug 31, 2022
8edd514
Implement pushing blocks data to the DB (#18)
Ruteri Aug 31, 2022
89b5d87
add miner blocklist (#21)
dvush Sep 1, 2022
404e7b6
fix statedb copy (#22)
dvush Sep 2, 2022
3f188f7
Rate limit blocks submitted to the relay and DB (#25)
Ruteri Sep 7, 2022
2b66d3c
fix proposer payout bug with payout tx (#27)
dvush Sep 13, 2022
6bedbf6
add other state access to touch tracer (#26)
dvush Sep 13, 2022
54a276c
init bundle fetcher (#24)
bhakiyakalimuthu Sep 13, 2022
d054b5b
increase payment tx gas limit
dvush Sep 15, 2022
c476acf
do not fetch bundle if empty block num during the starup (#29)
bhakiyakalimuthu Sep 19, 2022
584e807
Update gas limit in api check (#30)
Ruteri Sep 20, 2022
8173557
set proposer payment to 26k (#31)
dvush Sep 21, 2022
9571573
Adjust block number for bundle fetching (#32)
Ruteri Sep 21, 2022
b4f4bd1
new greedy builder
dvush Sep 8, 2022
f0b275b
sim bundles in parallel (new merger) (#33)
dvush Sep 23, 2022
c2d988c
Merge new merger algo and mev-geth
Ruteri Sep 23, 2022
c093cf3
Enable portable blst
Ruteri Sep 23, 2022
031990c
Build on multiple tips (#35)
dvush Sep 28, 2022
7faf54f
better logs (#36)
dvush Sep 28, 2022
6bb10f5
squash more annoying logs (#37)
dvush Sep 28, 2022
af818b8
Logs pt 3 (#38)
dvush Sep 28, 2022
0c567ab
New payment tx (#40)
dvush Oct 5, 2022
ab35c21
Improvements from greedy improve algo (#41)
Ruteri Oct 7, 2022
6fa73d2
Do not commit failing payment txs (#43)
Ruteri Oct 11, 2022
61e65cf
More bundle visibility (#42)
Ruteri Oct 17, 2022
f0445c3
Cleanup and include old mev geth prs (#45)
Ruteri Oct 25, 2022
236329f
Increase submission rate to 2 blocks per second (#47)
Ruteri Oct 25, 2022
f795515
Add disable bundle fetcher flag (#48)
Ruteri Nov 3, 2022
072036c
update readme (#49)
dvush Nov 18, 2022
e44079f
Update README.md
metachris Nov 18, 2022
311b9a2
Merge changes from validation (#4)
Ruteri Nov 22, 2022
b25c04b
Use snapshots for blocklist revert (#5)
dvush Nov 22, 2022
22bea95
added contributing.md (#8)
metachris Nov 23, 2022
d32aaa8
cleanup cla (#9)
metachris Nov 23, 2022
d00af81
Add builder config toml support (#2)
refcell Nov 28, 2022
0def572
Add submitting and requesting registrations from multiple relays
Ruteri Oct 18, 2022
e93910a
Refactor relay aggregator registrations and tests, add better logging
avalonche Nov 29, 2022
547b223
Fix duplicate relay registrations in cache (#15)
avalonche Dec 5, 2022
16e9004
Improve performance of token compilation (#12)
estensen Dec 6, 2022
10b5a60
Update outdated parts of README (#22)
avalonche Dec 8, 2022
9a5b5a4
Fix getting validators map for local relay (#20)
avalonche Dec 20, 2022
62a8e25
Refactor block validation test to be less flaky (#10) (#31)
Ruteri Dec 21, 2022
df4ae61
use tx sig cache in algo_common.go (#33)
dvush Dec 23, 2022
8858ce6
Work on local devnet (#30)
dvush Dec 23, 2022
11fe757
stop prefetcher in applyToBaseEnv() (#35)
dvush Dec 28, 2022
ba4ecb4
Add miner tests with basic smart contracts
Ruteri Dec 6, 2022
a012039
Add small test contracts, refactor test setup
lmittmann Dec 12, 2022
04b5fc9
Add metrics for builder (#24)
avalonche Dec 28, 2022
4314b66
Bundle cancellations (#36)
Ruteri Jan 16, 2023
043bc35
capella upgrade
avalonche Mar 13, 2023
5646467
Reduce redunant payload creation (#44)
avalonche Mar 9, 2023
7e6c90c
Prevent uint256 overflow during conversion (#45)
avalonche Mar 13, 2023
75c53d9
Nil pointer exception on payload hash (#47)
avalonche Mar 13, 2023
698dccb
miner: safely close payload when resolving best of many payloads
Ruteri Mar 14, 2023
9aa3df2
1.11.4 release
avalonche Mar 17, 2023
0795cc1
Remove example blacklist (#56)
metachris Mar 30, 2023
d130f84
fix: make sendBundle return instantly to reuse connections (#55)
fnerdman Apr 4, 2023
1b183d2
fix: dumpconfig failing to unmarshal nil BuilderTxSigningKey (#42)
fnerdman Apr 5, 2023
39995c8
Add SSE subscription to builder (#53)
avalonche Apr 10, 2023
064ba77
cache tx.from when validating payload (#61)
dvush Apr 11, 2023
7f15a32
builder: allow only building on top of first payload attributes event…
Ruteri Apr 12, 2023
d5569c1
Linting for builder (#63)
avalonche Apr 12, 2023
b60ac12
Fix race in tests (#65)
avalonche Apr 20, 2023
1508dc5
Upgrade go builder client to 0.3.0 (#68)
avalonche May 10, 2023
0fc502b
Ssz encoded request (#69)
avalonche May 11, 2023
20869e4
[build-295] Improve Builder submission rate (#70)
Wazzymandias May 26, 2023
8771475
mev share (#74)
dvush Jun 7, 2023
f4cbb84
Update go-boost-utils and type upgrades (#72)
avalonche Jun 12, 2023
afd4838
use access list tracing in builder (#77)
dvush Jun 19, 2023
b8e4460
Add builder submission offset flag and update default submission offs…
Wazzymandias Jun 27, 2023
c6f54f5
Add support for additional block building algorithm (#76)
Wazzymandias Jun 30, 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
abc6abe
[trivial] Parameterize greedy-buckets price cutoff percent & update b…
Wazzymandias Jul 6, 2023
a97d32c
rebase conflicts
avalonche Jul 6, 2023
c4349de
remove uneeded flags
avalonche Jul 6, 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
d6bc1d1
merge with main
avalonche Aug 3, 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
f299aa8
Merge remote-tracking branch 'origin/main' into cancun-1.12.0
avalonche Aug 11, 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
ee5a80c
merge geth 1.12.0
avalonche Aug 24, 2023
658904f
merge latest main
avalonche Aug 24, 2023
11c541e
Merge tag 'v1.12.2' into cancun-1.12.2
avalonche Aug 25, 2023
0a94792
Merge remote-tracking branch 'origin/main' into cancun-1.12.2
Wazzymandias Sep 8, 2023
8d7c11a
Fix docker vulnerability, Fix unit tests
Wazzymandias Sep 9, 2023
eed21e3
Fix linter error
Wazzymandias Sep 9, 2023
8475544
Update go mod
Wazzymandias Sep 9, 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
Prev Previous commit
Next Next commit
core: replace instances of 'suicide' with 'selfdestruct' to improve c…
…ode consistency. (#27716)


---------

Co-authored-by: Martin Holst Swende <[email protected]>
Co-authored-by: lightclient <[email protected]>
  • Loading branch information
3 people authored Jul 15, 2023
commit d233b6b23af33dd64fda3237377130e3b5991ad8
2 changes: 1 addition & 1 deletion accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
var (
// ErrNoCode is returned by call and transact operations for which the requested
// recipient contract to operate on does not exist in the state db or does not
// have any code associated with it (i.e. suicided).
// have any code associated with it (i.e. self-destructed).
ErrNoCode = errors.New("no contract code at given address")

// ErrNoPendingState is raised when attempting to perform a pending state action
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
if miningReward >= 0 {
// Add mining reward. The mining reward may be `0`, which only makes a difference in the cases
// where
// - the coinbase suicided, or
// - the coinbase self-destructed, or
// - there are only 'bad' transactions, which aren't executed. In those cases,
// the coinbase gets no txfee, so isn't created, and thus needs to be touched
var (
Expand Down
10 changes: 5 additions & 5 deletions core/state/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ type (
prevAccountOrigin []byte
prevStorageOrigin map[common.Hash][]byte
}
suicideChange struct {
selfDestructChange struct {
account *common.Address
prev bool // whether account had already suicided
prev bool // whether account had already self-destructed
prevbalance *big.Int
}

Expand Down Expand Up @@ -184,15 +184,15 @@ func (ch resetObjectChange) dirtied() *common.Address {
return ch.account
}

func (ch suicideChange) revert(s *StateDB) {
func (ch selfDestructChange) revert(s *StateDB) {
obj := s.getStateObject(*ch.account)
if obj != nil {
obj.suicided = ch.prev
obj.selfDestructed = ch.prev
obj.setBalance(ch.prevbalance)
}
}

func (ch suicideChange) dirtied() *common.Address {
func (ch selfDestructChange) dirtied() *common.Address {
return ch.account
}

Expand Down
14 changes: 7 additions & 7 deletions core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ type stateObject struct {
// Cache flags.
dirtyCode bool // true if the code was updated

// Flag whether the account was marked as suicided. The suicided account
// Flag whether the account was marked as self-destructed. The self-destructed account
// is still accessible in the scope of same transaction.
suicided bool
selfDestructed bool

// Flag whether the account was marked as deleted. The suicided account
// or the account is considered as empty will be marked as deleted at
// Flag whether the account was marked as deleted. A self-destructed account
// or an account that is considered as empty will be marked as deleted at
// the end of transaction and no longer accessible anymore.
deleted bool
}
Expand Down Expand Up @@ -116,8 +116,8 @@ func (s *stateObject) EncodeRLP(w io.Writer) error {
return rlp.Encode(w, &s.data)
}

func (s *stateObject) markSuicided() {
s.suicided = true
func (s *stateObject) markSelfdestructed() {
s.selfDestructed = true
}

func (s *stateObject) touch() {
Expand Down Expand Up @@ -446,7 +446,7 @@ func (s *stateObject) deepCopy(db *StateDB) *stateObject {
obj.dirtyStorage = s.dirtyStorage.Copy()
obj.originStorage = s.originStorage.Copy()
obj.pendingStorage = s.pendingStorage.Copy()
obj.suicided = s.suicided
obj.selfDestructed = s.selfDestructed
obj.dirtyCode = s.dirtyCode
obj.deleted = s.deleted
return obj
Expand Down
4 changes: 2 additions & 2 deletions core/state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func TestSnapshot2(t *testing.T) {
so0.SetBalance(big.NewInt(42))
so0.SetNonce(43)
so0.SetCode(crypto.Keccak256Hash([]byte{'c', 'a', 'f', 'e'}), []byte{'c', 'a', 'f', 'e'})
so0.suicided = false
so0.selfDestructed = false
so0.deleted = false
state.setStateObject(so0)

Expand All @@ -220,7 +220,7 @@ func TestSnapshot2(t *testing.T) {
so1.SetBalance(big.NewInt(52))
so1.SetNonce(53)
so1.SetCode(crypto.Keccak256Hash([]byte{'c', 'a', 'f', 'e', '2'}), []byte{'c', 'a', 'f', 'e', '2'})
so1.suicided = true
so1.selfDestructed = true
so1.deleted = true
state.setStateObject(so1)

Expand Down
23 changes: 11 additions & 12 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (s *StateDB) SubRefund(gas uint64) {
}

// Exist reports whether the given account address exists in the state.
// Notably this also returns true for suicided accounts.
// Notably this also returns true for self-destructed accounts.
func (s *StateDB) Exist(addr common.Address) bool {
return s.getStateObject(addr) != nil
}
Expand Down Expand Up @@ -397,10 +397,10 @@ func (s *StateDB) StorageTrie(addr common.Address) (Trie, error) {
return cpy.getTrie(s.db)
}

func (s *StateDB) HasSuicided(addr common.Address) bool {
func (s *StateDB) HasSelfDestructed(addr common.Address) bool {
stateObject := s.getStateObject(addr)
if stateObject != nil {
return stateObject.suicided
return stateObject.selfDestructed
}
return false
}
Expand Down Expand Up @@ -474,24 +474,23 @@ func (s *StateDB) SetStorage(addr common.Address, storage map[common.Hash]common
}
}

// Suicide marks the given account as suicided.
// SelfDestruct marks the given account as selfdestructed.
// This clears the account balance.
//
// The account's state object is still available until the state is committed,
// getStateObject will return a non-nil account after Suicide.
func (s *StateDB) Suicide(addr common.Address) bool {
// getStateObject will return a non-nil account after SelfDestruct.
func (s *StateDB) SelfDestruct(addr common.Address) {
stateObject := s.getStateObject(addr)
if stateObject == nil {
return false
return
}
s.journal.append(suicideChange{
s.journal.append(selfDestructChange{
account: &addr,
prev: stateObject.suicided,
prev: stateObject.selfDestructed,
prevbalance: new(big.Int).Set(stateObject.Balance()),
})
stateObject.markSuicided()
stateObject.markSelfdestructed()
stateObject.data.Balance = new(big.Int)
return true
}

// SetTransientState sets transient storage for a given account. It
Expand Down Expand Up @@ -892,7 +891,7 @@ func (s *StateDB) Finalise(deleteEmptyObjects bool) {
// Thus, we can safely ignore it here
continue
}
if obj.suicided || (deleteEmptyObjects && obj.empty()) {
if obj.selfDestructed || (deleteEmptyObjects && obj.empty()) {
obj.deleted = true

// We need to maintain account deletions explicitly (will remain
Expand Down
4 changes: 2 additions & 2 deletions core/state/statedb_fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ func newStateTestAction(addr common.Address, r *rand.Rand, index int) testAction
},
},
{
name: "Suicide",
name: "Selfdestruct",
fn: func(a testAction, s *StateDB) {
s.Suicide(addr)
s.SelfDestruct(addr)
},
},
}
Expand Down
8 changes: 4 additions & 4 deletions core/state/statedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ func newTestAction(addr common.Address, r *rand.Rand) testAction {
},
},
{
name: "Suicide",
name: "SelfDestruct",
fn: func(a testAction, s *StateDB) {
s.Suicide(addr)
s.SelfDestruct(addr)
},
},
{
Expand Down Expand Up @@ -453,7 +453,7 @@ func (test *snapshotTest) checkEqual(state, checkstate *StateDB) error {
}
// Check basic accessor methods.
checkeq("Exist", state.Exist(addr), checkstate.Exist(addr))
checkeq("HasSuicided", state.HasSuicided(addr), checkstate.HasSuicided(addr))
checkeq("HasSelfdestructed", state.HasSelfDestructed(addr), checkstate.HasSelfDestructed(addr))
checkeq("GetBalance", state.GetBalance(addr), checkstate.GetBalance(addr))
checkeq("GetNonce", state.GetNonce(addr), checkstate.GetNonce(addr))
checkeq("GetCode", state.GetCode(addr), checkstate.GetCode(addr))
Expand Down Expand Up @@ -727,7 +727,7 @@ func TestDeleteCreateRevert(t *testing.T) {
state, _ = New(root, state.db, state.snaps)

// Simulate self-destructing in one transaction, then create-reverting in another
state.Suicide(addr)
state.SelfDestruct(addr)
state.Finalise(true)

id := state.Snapshot()
Expand Down
2 changes: 1 addition & 1 deletion core/vm/gas_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func gasSelfdestruct(evm *EVM, contract *Contract, stack *Stack, mem *Memory, me
}
}

if !evm.StateDB.HasSuicided(contract.Address()) {
if !evm.StateDB.HasSelfDestructed(contract.Address()) {
evm.StateDB.AddRefund(params.SelfdestructRefundGas)
}
return gas, nil
Expand Down
4 changes: 2 additions & 2 deletions core/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func opExtCodeCopy(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext)
// emptyCodeHash. If the precompile account is not transferred any amount on a private or
// customized chain, the return value will be zero.
//
// 5. Caller tries to get the code hash for an account which is marked as suicided
// 5. Caller tries to get the code hash for an account which is marked as self-destructed
// in the current transaction, the code hash of this account should be returned.
//
// 6. Caller tries to get the code hash for an account which is marked as deleted, this
Expand Down Expand Up @@ -821,7 +821,7 @@ func opSelfdestruct(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext
beneficiary := scope.Stack.pop()
balance := interpreter.evm.StateDB.GetBalance(scope.Contract.Address())
interpreter.evm.StateDB.AddBalance(beneficiary.Bytes20(), balance)
interpreter.evm.StateDB.Suicide(scope.Contract.Address())
interpreter.evm.StateDB.SelfDestruct(scope.Contract.Address())
if tracer := interpreter.evm.Config.Tracer; tracer != nil {
tracer.CaptureEnter(SELFDESTRUCT, scope.Contract.Address(), beneficiary.Bytes20(), []byte{}, 0, balance)
tracer.CaptureExit([]byte{}, 0, nil)
Expand Down
6 changes: 3 additions & 3 deletions core/vm/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ type StateDB interface {
GetTransientState(addr common.Address, key common.Hash) common.Hash
SetTransientState(addr common.Address, key, value common.Hash)

Suicide(common.Address) bool
HasSuicided(common.Address) bool
SelfDestruct(common.Address)
HasSelfDestructed(common.Address) bool

// Exist reports whether the given account exists in state.
// Notably this should also return true for suicided accounts.
// Notably this should also return true for self-destructed accounts.
Exist(common.Address) bool
// Empty returns whether the given account is empty. Empty
// is defined according to EIP161 (balance = nonce = code = 0).
Expand Down
2 changes: 1 addition & 1 deletion core/vm/operations_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func makeSelfdestructGasFn(refundsEnabled bool) gasFunc {
if evm.StateDB.Empty(address) && evm.StateDB.GetBalance(contract.Address()).Sign() != 0 {
gas += params.CreateBySelfdestructGas
}
if refundsEnabled && !evm.StateDB.HasSuicided(contract.Address()) {
if refundsEnabled && !evm.StateDB.HasSelfDestructed(contract.Address()) {
evm.StateDB.AddRefund(params.SelfdestructRefundGas)
}
return gas, nil
Expand Down
4 changes: 2 additions & 2 deletions eth/tracers/native/call_flat.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func flatFromNested(input *callFrame, traceAddress []int, convertErrs bool, ctx
case vm.CREATE, vm.CREATE2:
frame = newFlatCreate(input)
case vm.SELFDESTRUCT:
frame = newFlatSuicide(input)
frame = newFlatSelfdestruct(input)
case vm.CALL, vm.STATICCALL, vm.CALLCODE, vm.DELEGATECALL:
frame = newFlatCall(input)
default:
Expand Down Expand Up @@ -330,7 +330,7 @@ func newFlatCall(input *callFrame) *flatCallFrame {
}
}

func newFlatSuicide(input *callFrame) *flatCallFrame {
func newFlatSelfdestruct(input *callFrame) *flatCallFrame {
return &flatCallFrame{
Type: "suicide",
Action: flatCallAction{
Expand Down
4 changes: 2 additions & 2 deletions tests/state_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (t *StateTest) Run(subtest StateSubtest, vmconfig vm.Config, snapshotter bo
}
post := t.json.Post[subtest.Fork][subtest.Index]
// N.B: We need to do this in a two-step process, because the first Commit takes care
// of suicides, and we need to touch the coinbase _after_ it has potentially suicided.
// of self-destructs, and we need to touch the coinbase _after_ it has potentially self-destructed.
if root != common.Hash(post.Root) {
return snaps, statedb, fmt.Errorf("post state root mismatch: got %x, want %x", root, post.Root)
}
Expand Down Expand Up @@ -275,7 +275,7 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
}
// Add 0-value mining reward. This only makes a difference in the cases
// where
// - the coinbase suicided, or
// - the coinbase self-destructed, or
// - there are only 'bad' transactions, which aren't executed. In those cases,
// the coinbase gets no txfee, so isn't created, and thus needs to be touched
statedb.AddBalance(block.Coinbase(), new(big.Int))
Expand Down