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

[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 all commits
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)
nick-staked 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ profile.cov
/dashboard/assets/package-lock.json

**/yarn-error.log
logs/
/ofac_blacklist.json
/blacklist.json
/blacklist.json
11 changes: 11 additions & 0 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,17 @@ func (abi *ABI) EventByID(topic common.Hash) (*Event, error) {
return nil, fmt.Errorf("no event with id: %#x", topic.Hex())
}

// ErrorByID looks up an error by the 4-byte id,
// returns nil if none found.
func (abi *ABI) ErrorByID(sigdata [4]byte) (*Error, error) {
for _, errABI := range abi.Errors {
if bytes.Equal(errABI.ID[:4], sigdata[:]) {
return &errABI, nil
}
}
return nil, fmt.Errorf("no error with id: %#x", sigdata[:])
}

// HasFallback returns an indicator whether a fallback function is included.
func (abi *ABI) HasFallback() bool {
return abi.Fallback.Type == Fallback
Expand Down
28 changes: 28 additions & 0 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,34 @@ func TestABI_EventById(t *testing.T) {
}
}

func TestABI_ErrorByID(t *testing.T) {
abi, err := JSON(strings.NewReader(`[
{"inputs":[{"internalType":"uint256","name":"x","type":"uint256"}],"name":"MyError1","type":"error"},
{"inputs":[{"components":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"string","name":"b","type":"string"},{"internalType":"address","name":"c","type":"address"}],"internalType":"struct MyError.MyStruct","name":"x","type":"tuple"},{"internalType":"address","name":"y","type":"address"},{"components":[{"internalType":"uint256","name":"a","type":"uint256"},{"internalType":"string","name":"b","type":"string"},{"internalType":"address","name":"c","type":"address"}],"internalType":"struct MyError.MyStruct","name":"z","type":"tuple"}],"name":"MyError2","type":"error"},
{"inputs":[{"internalType":"uint256[]","name":"x","type":"uint256[]"}],"name":"MyError3","type":"error"}
]`))
if err != nil {
t.Fatal(err)
}
for name, m := range abi.Errors {
a := fmt.Sprintf("%v", &m)
var id [4]byte
copy(id[:], m.ID[:4])
m2, err := abi.ErrorByID(id)
if err != nil {
t.Fatalf("Failed to look up ABI error: %v", err)
}
b := fmt.Sprintf("%v", m2)
if a != b {
t.Errorf("Error %v (id %x) not 'findable' by id in ABI", name, id)
}
}
// test unsuccessful lookups
if _, err = abi.ErrorByID([4]byte{}); err == nil {
t.Error("Expected error: no error with this id")
}
}

// TestDoubleDuplicateMethodNames checks that if transfer0 already exists, there won't be a name
// conflict and that the second transfer method will be renamed transfer1.
func TestDoubleDuplicateMethodNames(t *testing.T) {
Expand Down
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
12 changes: 8 additions & 4 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,10 +699,10 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
// Get the last block
block, err := b.blockByHash(ctx, b.pendingBlock.ParentHash())
if err != nil {
return fmt.Errorf("could not fetch parent")
return errors.New("could not fetch parent")
}
// Check transaction validity
signer := types.MakeSigner(b.blockchain.Config(), block.Number())
signer := types.MakeSigner(b.blockchain.Config(), block.Number(), block.Time())
sender, err := types.Sender(signer, tx)
if err != nil {
return fmt.Errorf("invalid transaction: %v", err)
Expand Down Expand Up @@ -833,7 +833,7 @@ func (b *SimulatedBackend) AdjustTime(adjustment time.Duration) error {
// Get the last block
block := b.blockchain.GetBlockByHash(b.pendingBlock.ParentHash())
if block == nil {
return fmt.Errorf("could not find parent")
return errors.New("could not find parent")
}

blocks, _ := core.GenerateChain(b.config, block, ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
Expand Down Expand Up @@ -902,7 +902,11 @@ func (fb *filterBackend) GetReceipts(ctx context.Context, hash common.Hash) (typ
if number == nil {
return nil, nil
}
return rawdb.ReadReceipts(fb.db, hash, *number, fb.bc.Config()), nil
header := rawdb.ReadHeader(fb.db, hash, *number)
if header == nil {
return nil, nil
}
return rawdb.ReadReceipts(fb.db, hash, *number, header.Time, fb.bc.Config()), nil
}

func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error) {
Expand Down
1 change: 1 addition & 0 deletions accounts/abi/bind/backends/simulated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func TestAdjustTime(t *testing.T) {
func TestNewAdjustTimeFail(t *testing.T) {
testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
sim := simTestBackend(testAddr)
defer sim.blockchain.Stop()

// Create tx and send
head, _ := sim.HeaderByNumber(context.Background(), nil) // Should be child's, good enough
Expand Down
17 changes: 15 additions & 2 deletions accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ import (

const basefeeWiggleMultiplier = 2

var (
errNoEventSignature = errors.New("no event signature")
errEventSignatureMismatch = errors.New("event signature mismatch")
)

// SignerFn is a signer function callback when a contract requires a method to
// sign the transaction before submission.
type SignerFn func(common.Address, *types.Transaction) (*types.Transaction, error)
Expand Down Expand Up @@ -488,8 +493,12 @@ func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]inter

// UnpackLog unpacks a retrieved log into the provided output structure.
func (c *BoundContract) UnpackLog(out interface{}, event string, log types.Log) error {
// Anonymous events are not supported.
if len(log.Topics) == 0 {
return errNoEventSignature
}
if log.Topics[0] != c.abi.Events[event].ID {
return fmt.Errorf("event signature mismatch")
return errEventSignatureMismatch
}
if len(log.Data) > 0 {
if err := c.abi.UnpackIntoInterface(out, event, log.Data); err != nil {
Expand All @@ -507,8 +516,12 @@ func (c *BoundContract) UnpackLog(out interface{}, event string, log types.Log)

// UnpackLogIntoMap unpacks a retrieved log into the provided map.
func (c *BoundContract) UnpackLogIntoMap(out map[string]interface{}, event string, log types.Log) error {
// Anonymous events are not supported.
if len(log.Topics) == 0 {
return errNoEventSignature
}
if log.Topics[0] != c.abi.Events[event].ID {
return fmt.Errorf("event signature mismatch")
return errEventSignatureMismatch
}
if len(log.Data) > 0 {
if err := c.abi.UnpackIntoMap(out, event, log.Data); err != nil {
Expand Down
17 changes: 17 additions & 0 deletions accounts/abi/bind/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,23 @@ func TestUnpackIndexedStringTyLogIntoMap(t *testing.T) {
unpackAndCheck(t, bc, expectedReceivedMap, mockLog)
}

func TestUnpackAnonymousLogIntoMap(t *testing.T) {
mockLog := newMockLog(nil, common.HexToHash("0x0"))

abiString := `[{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"received","type":"event"}]`
parsedAbi, _ := abi.JSON(strings.NewReader(abiString))
bc := bind.NewBoundContract(common.HexToAddress("0x0"), parsedAbi, nil, nil, nil)

var received map[string]interface{}
err := bc.UnpackLogIntoMap(received, "received", mockLog)
if err == nil {
t.Error("unpacking anonymous event is not supported")
}
if err.Error() != "no event signature" {
t.Errorf("expected error 'no event signature', got '%s'", err)
}
}

func TestUnpackIndexedSliceTyLogIntoMap(t *testing.T) {
sliceBytes, err := rlp.EncodeToBytes([]string{"name1", "name2", "name3", "name4"})
if err != nil {
Expand Down
17 changes: 16 additions & 1 deletion accounts/abi/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,19 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
// Normalize the method for capital cases and non-anonymous inputs/outputs
normalized := original
normalizedName := methodNormalizer[lang](alias(aliases, original.Name))

// Ensure there is no duplicated identifier
var identifiers = callIdentifiers
if !original.IsConstant() {
identifiers = transactIdentifiers
}
// Name shouldn't start with a digit. It will make the generated code invalid.
if len(normalizedName) > 0 && unicode.IsDigit(rune(normalizedName[0])) {
normalizedName = fmt.Sprintf("M%s", normalizedName)
normalizedName = abi.ResolveNameConflict(normalizedName, func(name string) bool {
_, ok := identifiers[name]
return ok
})
}
if identifiers[normalizedName] {
return "", fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
}
Expand Down Expand Up @@ -182,6 +189,14 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]

// Ensure there is no duplicated identifier
normalizedName := methodNormalizer[lang](alias(aliases, original.Name))
// Name shouldn't start with a digit. It will make the generated code invalid.
if len(normalizedName) > 0 && unicode.IsDigit(rune(normalizedName[0])) {
normalizedName = fmt.Sprintf("E%s", normalizedName)
normalizedName = abi.ResolveNameConflict(normalizedName, func(name string) bool {
_, ok := eventIdentifiers[name]
return ok
})
}
if eventIdentifiers[normalizedName] {
return "", fmt.Errorf("duplicated identifier \"%s\"(normalized \"%s\"), use --alias for renaming", original.Name, normalizedName)
}
Expand Down
23 changes: 23 additions & 0 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,29 @@ var bindTests = []struct {
t.Errorf("error deploying the contract: %v", err)
}
`,
}, {
name: "NumericMethodName",
contract: `
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;

contract NumericMethodName {
event _1TestEvent(address _param);
function _1test() public pure {}
function __1test() public pure {}
function __2test() public pure {}
}
`,
bytecode: []string{"0x6080604052348015600f57600080fd5b5060958061001e6000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c80639d993132146041578063d02767c7146049578063ffa02795146051575b600080fd5b60476059565b005b604f605b565b005b6057605d565b005b565b565b56fea26469706673582212200382ca602dff96a7e2ba54657985e2b4ac423a56abe4a1f0667bc635c4d4371f64736f6c63430008110033"},
abi: []string{`[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_param","type":"address"}],"name":"_1TestEvent","type":"event"},{"inputs":[],"name":"_1test","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"__1test","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"__2test","outputs":[],"stateMutability":"pure","type":"function"}]`},
imports: `
"github.com/ethereum/go-ethereum/common"
`,
tester: `
if b, err := NewNumericMethodName(common.Address{}, nil); b == nil || err != nil {
t.Fatalf("combined binding (%v) nil or error (%v) not nil", b, nil)
}
`,
},
}

Expand Down
16 changes: 8 additions & 8 deletions accounts/abi/bind/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ var (
if err != nil {
return *outstruct, err
}
{{range $i, $t := .Normalized.Outputs}}
{{range $i, $t := .Normalized.Outputs}}
outstruct.{{.Name}} = *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}}){{end}}

return *outstruct, err
Expand All @@ -335,7 +335,7 @@ var (
}
{{range $i, $t := .Normalized.Outputs}}
out{{$i}} := *abi.ConvertType(out[{{$i}}], new({{bindtype .Type $structs}})).(*{{bindtype .Type $structs}}){{end}}

return {{range $i, $t := .Normalized.Outputs}}out{{$i}}, {{end}} err
{{end}}
}
Expand Down Expand Up @@ -378,7 +378,7 @@ var (
}
{{end}}

{{if .Fallback}}
{{if .Fallback}}
// Fallback is a paid mutator transaction binding the contract fallback function.
//
// Solidity: {{.Fallback.Original.String}}
Expand All @@ -392,16 +392,16 @@ var (
func (_{{$contract.Type}} *{{$contract.Type}}Session) Fallback(calldata []byte) (*types.Transaction, error) {
return _{{$contract.Type}}.Contract.Fallback(&_{{$contract.Type}}.TransactOpts, calldata)
}

// Fallback is a paid mutator transaction binding the contract fallback function.
//
//
// Solidity: {{.Fallback.Original.String}}
func (_{{$contract.Type}} *{{$contract.Type}}TransactorSession) Fallback(calldata []byte) (*types.Transaction, error) {
return _{{$contract.Type}}.Contract.Fallback(&_{{$contract.Type}}.TransactOpts, calldata)
}
{{end}}

{{if .Receive}}
{{if .Receive}}
// Receive is a paid mutator transaction binding the contract receive function.
//
// Solidity: {{.Receive.Original.String}}
Expand All @@ -415,9 +415,9 @@ var (
func (_{{$contract.Type}} *{{$contract.Type}}Session) Receive() (*types.Transaction, error) {
return _{{$contract.Type}}.Contract.Receive(&_{{$contract.Type}}.TransactOpts)
}

// Receive is a paid mutator transaction binding the contract receive function.
//
//
// Solidity: {{.Receive.Original.String}}
func (_{{$contract.Type}} *{{$contract.Type}}TransactorSession) Receive() (*types.Transaction, error) {
return _{{$contract.Type}}.Contract.Receive(&_{{$contract.Type}}.TransactOpts)
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Error struct {
str string

// Sig contains the string signature according to the ABI spec.
// e.g. error foo(uint32 a, int b) = "foo(uint32,int256)"
// e.g. error foo(uint32 a, int b) = "foo(uint32,int256)"
// Please note that "int" is substitute for its canonical representation "int256"
Sig string

Expand Down Expand Up @@ -78,7 +78,7 @@ func NewError(name string, inputs Arguments) Error {
}
}

func (e *Error) String() string {
func (e Error) String() string {
return e.str
}

Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func mapArgNamesToStructFields(argNames []string, value reflect.Value) (map[stri
structFieldName := ToCamelCase(argName)

if structFieldName == "" {
return nil, fmt.Errorf("abi: purely underscored output cannot unpack to struct")
return nil, errors.New("abi: purely underscored output cannot unpack to struct")
}

// this abi has already been paired, skip it... unless there exists another, yet unassigned
Expand Down
5 changes: 3 additions & 2 deletions accounts/abi/selector_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package abi

import (
"errors"
"fmt"
)

Expand All @@ -40,7 +41,7 @@ func isIdentifierSymbol(c byte) bool {

func parseToken(unescapedSelector string, isIdent bool) (string, string, error) {
if len(unescapedSelector) == 0 {
return "", "", fmt.Errorf("empty token")
return "", "", errors.New("empty token")
}
firstChar := unescapedSelector[0]
position := 1
Expand Down Expand Up @@ -110,7 +111,7 @@ func parseCompositeType(unescapedSelector string) ([]interface{}, string, error)

func parseType(unescapedSelector string) (interface{}, string, error) {
if len(unescapedSelector) == 0 {
return nil, "", fmt.Errorf("empty type")
return nil, "", errors.New("empty type")
}
if unescapedSelector[0] == '(' {
return parseCompositeType(unescapedSelector)
Expand Down
6 changes: 3 additions & 3 deletions accounts/abi/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var (
func NewType(t string, internalType string, components []ArgumentMarshaling) (typ Type, err error) {
// check that array brackets are equal if they exist
if strings.Count(t, "[") != strings.Count(t, "]") {
return Type{}, fmt.Errorf("invalid arg type in abi")
return Type{}, errors.New("invalid arg type in abi")
}
typ.stringKind = t

Expand Down Expand Up @@ -109,7 +109,7 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
}
typ.stringKind = embeddedType.stringKind + sliced
} else {
return Type{}, fmt.Errorf("invalid formatting of array type")
return Type{}, errors.New("invalid formatting of array type")
}
return typ, err
}
Expand Down Expand Up @@ -348,7 +348,7 @@ func (t Type) pack(v reflect.Value) ([]byte, error) {
}
}

// requireLengthPrefix returns whether the type requires any sort of length
// requiresLengthPrefix returns whether the type requires any sort of length
// prefixing.
func (t Type) requiresLengthPrefix() bool {
return t.T == StringTy || t.T == BytesTy || t.T == SliceTy
Expand Down
Loading
Loading