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

Merge v1.10.25 v2 #13

Merged
merged 190 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
531ff17
tests/fuzzers/bls12381: fix blst deserializing (#25036)
MariusVanDerWijden Jun 6, 2022
d0dd55d
cmd/geth, core/state/snapshot: rework journal loading, implement acco…
holiman Jun 6, 2022
f391a11
all: introduce trie owner notion (#24750)
rjl493456442 Jun 6, 2022
19f4e78
eth/api: use `hexutil.Bytes` for account range method (#25024)
lightclient Jun 6, 2022
b44d406
eth/tracers: fix typo in 4byte_tracer_legacy.js (#25020)
eltociear Jun 6, 2022
a5ceee5
trie: move locking into trieDB insert method (#25030)
aaronbuchwald Jun 7, 2022
80db4fb
params: update ropsten terminal total difficulty block (#25018)
holiman Jun 7, 2022
8d2c317
eth/filters: fix getLogs for pending block (#24949)
s1na Jun 7, 2022
6620ca6
accounts/abi/bind: fix duplicate field names in the generated go stru…
lwhile Jun 7, 2022
6075918
tests/fuzzers/bls12381: fix blst pairing (#25037)
MariusVanDerWijden Jun 7, 2022
06ba0ab
p2p/discover: fix panicky test (#25038)
holiman Jun 7, 2022
f9d119f
accounts: increase parseURL test coverage (#25033)
dbadoy Jun 7, 2022
7b60226
eth, les, params: log chain config a bit saner (#24904)
karalabe Jun 7, 2022
8035674
p2p: use errors.Is for error comparison (#24882)
estensen Jun 7, 2022
d14615d
rpc: swap out timer metrics to histograms
karalabe Jun 8, 2022
3d1afdf
eth/catalyst: remove unauthenticated 'engine' api (#24997)
holiman Jun 8, 2022
f678ca9
core/types: remove unused field 'td' in Block (#25010)
zimbabao Jun 8, 2022
a5280f1
core/types: improve LogForStorage and ReceiptForStorage comments (#25…
henridf Jun 8, 2022
fbd3ef2
core/evm: fix error in comment (#25040)
int88 Jun 8, 2022
47d51e3
internal/ethapi: fix typo in comment (#25056)
LuozhuZhang Jun 10, 2022
c77f97d
Chore: Minimal gramatical errors (signleton -> singleton) (#25057)
GustavoRSSilva Jun 10, 2022
337c4f3
all: more linters (#24783)
holiman Jun 13, 2022
209a4d2
cmd/utils: update --ropsten description (#25078)
Aracki Jun 14, 2022
5c120fc
readme,eth: remove references to eth.wiki (#25086)
lightclient Jun 14, 2022
8ebbd88
cmd/ethkey: use accounts.TextHash (#25069)
s7v7nislands Jun 14, 2022
bfea685
common: improve pretty duration regex (#25073)
MariusVanDerWijden Jun 14, 2022
e5cf465
all: prefer `new(big.Int)` over `big.NewInt(0)` (#25087)
lmittmann Jun 14, 2022
5702dff
eth: add missing period at end of sentences (#25058)
lightclient Jun 15, 2022
842ed75
eth: introduce eth67 protocol (#24093)
rjl493456442 Jun 15, 2022
ea4df95
cmd, params: implement Gray Glacier hard-fork (EIP-5133) (#25088)
MariusVanDerWijden Jun 15, 2022
d276a9a
node: add info message when JWT secret is loaded (#25095)
MariusVanDerWijden Jun 15, 2022
9970084
params: release Geth v1.10.19
karalabe Jun 15, 2022
2810768
params: begin v1.10.20 release cycle
karalabe Jun 15, 2022
52281e0
internal/ethapi: add comment explaining return of nil instead of erro…
kosuke-taniguchi Jun 16, 2022
e076043
tests/fuzzers/rlp: avoid very large input (#25109)
holiman Jun 16, 2022
3b1a535
node: make jwt tests less time-dependent (#25120)
holiman Jun 20, 2022
6e2c622
cmd/faucet: more verbose message about private posts (#25129)
Zachinquarantine Jun 20, 2022
6288b5e
internal/ethapi: remove SignAndSendTransaction (#25111)
s1na Jun 20, 2022
25505f8
cmd/faucet: add sepolia network support (#25128)
Zachinquarantine Jun 20, 2022
22a74a9
trie: fix size accounting in cleaner (#25007)
aaronbuchwald Jun 21, 2022
f7c6881
all: remove concept of public/private API definitions (#25053)
lightclient Jun 21, 2022
5292c32
cmd/geth: drop geth js command (#25000)
s1na Jun 21, 2022
e657295
README,rpc: remove mention of "shh" RPC API (#25137)
Zachinquarantine Jun 21, 2022
77b4bc5
eth, miner: retrieve mining state from live database (#25139)
rjl493456442 Jun 22, 2022
b106724
core: fix typo in txpool (#25149)
aaronbuchwald Jun 22, 2022
ef74471
go.mod: upgrade to latest goleveldb (#25067)
ucwong Jun 23, 2022
d32726f
eth/tracers: optimize goja buffer conversion (#25156)
s1na Jun 23, 2022
6b4dcbf
eth: fix typo (#25161)
int88 Jun 24, 2022
ba3c0f0
internal/ethapi: always return chain id (#25166)
lightclient Jun 24, 2022
45b19c1
internal/ethapi: add note about eth_chainId compatibility with EIP-69…
lightclient Jun 25, 2022
9ec953e
all: remove `public` field from `rpc.API` (#25059)
lightclient Jun 27, 2022
f517592
cmd: migrate to urfave/cli/v2 (#24751)
willianpaixao Jun 27, 2022
7942a41
params: set TTD for sepolia testnet (#25179)
MariusVanDerWijden Jun 28, 2022
1d38c04
cmd/geth, p2p: add support for custom discovery UDP port (#24979)
zeim839 Jun 28, 2022
e5e3b03
fix: linter warning (#25192)
gballet Jun 29, 2022
22c8e3a
core/rawdb: fix typo in comment (#25191)
noirgif Jun 29, 2022
3a47244
core/rawdb: simplify TestDiskSeek to use memorydb (#25182)
aaronbuchwald Jun 29, 2022
ab45f1e
cmd/utils: fix applying bootstrap nodes from config file (#25174)
andrepatta Jun 29, 2022
9ac1d30
internal/ethapi: return chain id for EIP-155 legacy txs (#25155)
lightclient Jun 29, 2022
d9ff39c
common: increase StorageSize test coverage (#25188)
dbadoy Jun 29, 2022
6543031
consensus/beacon: check that only the latest pow block is valid ttd b…
MariusVanDerWijden Jun 29, 2022
2b07f0d
build: fix auto-completion scripts and include them in .deb package (…
willianpaixao Jun 29, 2022
8f1c17d
build: upgrade to golangci-lint v1.46.2 (#25202)
fjl Jun 29, 2022
eee6750
build/deb: fix auto-completion install paths (#25204)
fjl Jun 29, 2022
6f35780
params: go-ethereum v1.10.20 stable
fjl Jun 29, 2022
f429a79
params: begin v1.10.21 release cycle
fjl Jun 29, 2022
f2323ef
common/prque: fix typo
dbadoy Jun 30, 2022
a3f1387
eth/catalyst: disallow importing blocks via newPayload during snap sy…
karalabe Jul 1, 2022
804525a
Replace fmt.Errorf with errors.New in abi argument (#25181)
aaronbuchwald Jul 4, 2022
652ce57
all: change format `0x%x` to `%#x` (#25221)
dbadoy Jul 4, 2022
77828e3
consensus/beacon: copy td value so we can modify it (#25230)
MariusVanDerWijden Jul 4, 2022
8052b63
core: allow external code to set the block validator for malicious te…
MariusVanDerWijden Jul 4, 2022
8ebcd52
core: apply ttd override to uninitialized db (#25136)
MariusVanDerWijden Jul 4, 2022
703beb3
signer/core/apitypes: support primitive types int96/uint96 (#25105)
spkjp Jul 4, 2022
8cbcc6c
cmd/geth, cmd/devp2p: fix some cli parsing issues (#25234)
fjl Jul 4, 2022
9875caf
core: allow external processor (#25233)
MariusVanDerWijden Jul 5, 2022
65ce2b2
consensus/beacon: verify timestamp is greater than parent timestamp (…
MariusVanDerWijden Jul 5, 2022
bde7ac7
go.mod: updated logfmt dependency (#25231)
MariusVanDerWijden Jul 5, 2022
4c6a9ad
internal/ethapi: add basefee to block overrides (#25219)
s1na Jul 5, 2022
c434479
trie: fix typo in comment (#25241)
aaronbuchwald Jul 6, 2022
95ee0c5
core/types: fix typo in comment (#25249)
dbadoy Jul 6, 2022
6ae812f
internal/ethapi: fix chain ID check to return all non-zero IDs (#25244)
lightclient Jul 7, 2022
784ff14
rpc: add graceful shutdown timeout for HTTP server (#25258)
windycrypto Jul 8, 2022
ed0dc74
p2p/discover: fix typos in comments (#25272)
dbadoy Jul 10, 2022
1d88179
build: upgrade -dlgo version to Go 1.18.3
sandakersmann Jul 5, 2022
ce6afa3
core, eth: pre-allocate map in storage copy (#25279)
dbadoy Jul 12, 2022
6e1c728
eth/tracers: add initial revertReasonTracer tracer (#25265)
fanbsb Jul 12, 2022
d98417f
params: enable DNS discovery on Sepolia too
karalabe Jul 12, 2022
ca9ed59
internal/build: add a timestamp to the tar archive folder
karalabe Jul 12, 2022
e141cd9
build: upgrade -dlgo version to Go 1.18.4
sandakersmann Jul 12, 2022
b80904e
accounts/abi: fix typo in comment (#25271)
eltociear Jul 14, 2022
22f5e83
accounts/abi/bind/backends: return hash of new blocks (#25163)
DragonDev1906 Jul 14, 2022
6f93ff9
all: remove version field from rpc.API
lightclient Jun 15, 2022
ecad8d6
internal/ethapi: error if tx args includes chain id that doesn't matc…
lightclient Jul 14, 2022
59ac828
core: remove lock in BlockChain.ExportN (#25254)
henridf Jul 14, 2022
5240444
core: prevent negative fee during RPC calls (#25214)
PlasmaPower Jul 15, 2022
67064d8
core, les, eth: port snap sync changes (#24898)
rjl493456442 Jul 15, 2022
e930c6a
tests: only activate merge on london rules (#25239)
MariusVanDerWijden Jul 15, 2022
924c2af
trie: fix 'gosimple' lint issue (#25309)
fjl Jul 15, 2022
815c446
p2p/discover: apply netrestrict in discv5 response handler (#25304)
hadv Jul 15, 2022
bf994e2
cmd/geth: remove redundant 0x in dbGet/dbDelete (#25315)
gballet Jul 18, 2022
c32b8f0
accounts/abi: substitude arg%d to the range keyword (#25307)
gballet Jul 19, 2022
10be390
params: Add Shanghai and Cancun blocks (#25305)
gballet Jul 19, 2022
08c33fc
cmd/puppeth: remove support for exporting non-Geth genesis configurat…
jwasinger Jul 22, 2022
9a6cd15
params: set goerli TTD to 10_790_000 (#25324)
MariusVanDerWijden Jul 22, 2022
824ee3f
signer/core: add canonical TypedData hashing methods (#25283)
nik-suri Jul 22, 2022
38c2d17
params: set sepolia mergeNetsplitBlock to 1735371 (#25372)
MariusVanDerWijden Jul 23, 2022
97269f0
cmd/geth: eth/catalyst: enable authrpc by default (#25152)
MariusVanDerWijden Jul 23, 2022
c155029
deps: update goleveldb
holiman Jul 23, 2022
d196476
eth/catalyst: better warning for ttd not configured (#25394)
MariusVanDerWijden Jul 25, 2022
13b02e7
cmd: use flags.Merge for grouping flags (#25392)
rjl493456442 Jul 25, 2022
36f4fa3
consensus/beacon: fix typo in comment (#25391)
gballet Jul 25, 2022
bed838a
p2p/netutil: minor code cosmetic
Abirdcfly Jul 25, 2022
303cdb1
eth, internal, light: fix error string capitalization (#25364)
dbadoy Jul 25, 2022
bf80eb7
light: fix differTries err message in tests (#25358)
eval-exec Jul 25, 2022
45e0f84
all: add whitespace linter (#25312)
jsvisa Jul 25, 2022
d4862cb
eth/tracers/js: fix capitalization in tests
karalabe Jul 25, 2022
46c12c7
eth: support bubbling up bad blocks from sync to the engine API (#25190)
karalabe Jul 25, 2022
aa217a1
params: change Merge config to print simpler message
Zachinquarantine Jul 21, 2022
f594da2
core: eth: rpc: implement safe rpc block (#25165)
MariusVanDerWijden Jul 25, 2022
9387cdf
go.mod: downgrade leveldb (#25413)
rjl493456442 Jul 27, 2022
f702612
params: go-ethereum v1.10.21 stable
fjl Jul 27, 2022
baae0a4
params: begin v1.10.22 release cycle
fjl Jul 27, 2022
bb98783
core, trie, eth, cmd: rework preimage store (#25287)
rjl493456442 Jul 27, 2022
03cc189
eth/catalyst: fix NewPayload warn log when dropping due to snap sync
karalabe Jul 28, 2022
cde4554
node: set JWT expiry to 60 seconds (#25416)
MariusVanDerWijden Jul 28, 2022
5546917
eth/catalyst: return syncing not accepted (#25414)
MariusVanDerWijden Jul 28, 2022
f5a4c75
eth/catalyst: return 0x0 if latestvalid is pow block (#25423)
MariusVanDerWijden Jul 28, 2022
90d297a
ethereum, ethclient: add FeeHistory support (#25403)
lightclient Jul 29, 2022
4b216ed
all: use AbsTime.Add instead of conversion (#25417)
dbadoy Jul 29, 2022
9d1f8d8
cm/puppeth: fix crash when of ethstats specifier doesn't contain `:` …
jsvisa Jul 29, 2022
2193d12
eth: fix typo in comment (#25327)
rithwikbabu Jul 29, 2022
59d6dba
common/compiler: json unmarshalling error checks (#25449)
henry-0 Aug 1, 2022
08a2784
cmd, core, eth, les, params: add merge-passed chain config (#24538)
karalabe Aug 1, 2022
b92727b
eth: fix typo in catalyst api (#25460)
s1na Aug 1, 2022
8c5c4a4
eth/gasprice/feehistory: support finalized block (#25442)
lightclient Aug 1, 2022
7c8b903
build: upgrade -dlgo version to Go 1.18.5
sandakersmann Aug 1, 2022
679c151
consensus/ethash: remove temp files created during DAG generation (#2…
manoj398 Aug 2, 2022
aaaf4b9
cmd/devp2p/internal/ethtest: update tests for eth/67 (#25306)
fjl Aug 2, 2022
9d60f95
node, rpc: add ReadHeaderTimeout config option (#25338)
Tristan-Wilson Aug 3, 2022
63c30d5
core/types: fix typo in comment (#25359)
yzhaoyu Aug 3, 2022
487a622
core: preallocate batch size in bloomIndexer (#25289)
dbadoy Aug 3, 2022
4c78342
internal/ethapi: don't estimate gas if no limit provided in eth_creat…
lightclient Aug 3, 2022
136c475
graphql: embed *Resolver instead of backend interface (#25468)
fjl Aug 3, 2022
a29d7f8
node: remove noop path.Join (#25475)
jsvisa Aug 4, 2022
e1773dc
core, trie: rework trie committer (#25320)
rjl493456442 Aug 4, 2022
cb3fba8
core: use TryGetAccount to read what TryUpdateAccount has written (#2…
gballet Aug 4, 2022
1300fb2
cmd, core, ethdb, node: move chain freezer one folder deeper (#25487)
rjl493456442 Aug 8, 2022
07a48b3
eth/downloader: fix log errors of queue_test.go (#25494)
int88 Aug 8, 2022
e57e841
core: fix uncle creation in TestFastVsFullChains (#25476)
int88 Aug 8, 2022
0350be6
eth: formatted error nit (#25499)
aaronbuchwald Aug 9, 2022
687caf4
eth/tracers: add onlyTopCall option to callTracer (#25430)
s1na Aug 9, 2022
92f3a88
all: cleanup the APIs for initializing genesis (#25473)
rjl493456442 Aug 9, 2022
1ca78af
signer/rules: register clef api properly when rules are used (#25455)
holiman Aug 10, 2022
6caca2e
core: remove unused bc ChainContext in applyTransaction
ycyraum Aug 10, 2022
ef49fef
build: add static linking support (#25492)
0xe3b0c4 Aug 10, 2022
21c7883
accounts/abi: display name in "method/event not found" error (#25512)
darioush Aug 11, 2022
277e798
internal/ethapi: rework setDefaults for tx args so fee logic is separ…
lightclient Aug 11, 2022
0048c17
core/genesis: remove calaverasAllocData (#25516)
ycyraum Aug 12, 2022
a0dca6b
params: set ttdpassed on goerli (#25519)
holiman Aug 15, 2022
8781584
params: set mainnet terminal total difficulty for the merge (#25528)
MariusVanDerWijden Aug 16, 2022
535b154
core, trie: flush preimages to db on blockchain close (#25533)
gballet Aug 17, 2022
6ac43e5
core/state, trie, light: add a TryDeleteAccount method (#25531)
gballet Aug 17, 2022
86bf6b0
core: make tx journal check and open atomic (#25530)
dbadoy Aug 17, 2022
b6efce8
cmd. core: save preimages on genesis creation (#25538)
gballet Aug 18, 2022
e09ac14
rlp/rlpgen: fix error handling when target type not found (#25547)
jtraglia Aug 18, 2022
6f944e0
trie: improve node rlp decoding performance (#25357)
rjl493456442 Aug 18, 2022
6bdf042
all: fix some typos (#25551)
jtraglia Aug 19, 2022
c1c2f07
internal/ethapi: fix comment typo (#25548)
ucwong Aug 19, 2022
84464de
accounts/abi/bind/backends: typo fix (#25549)
ucwong Aug 19, 2022
81efdf1
eth, les: unlock downloader peerSet if there's an error (#25546)
jtraglia Aug 19, 2022
a99e481
cmd/geth: parse uint64 value with ParseUint instead of Atoi (#25545)
jtraglia Aug 19, 2022
133f9dd
consensus/beacon: check ttd reached on pos blocks (#25552)
MariusVanDerWijden Aug 19, 2022
d9c73d6
eth/filters: add global block logs cache (#25459)
s1na Aug 19, 2022
2693971
accounts/abi: fix set function (#25477)
zhiqiangxu Aug 19, 2022
dfac8b9
internal/ethapi: fix build regression (#25555)
fjl Aug 19, 2022
33b52f4
eth/fetcher: don't spend too much time on transaction inclusion (#25524)
holiman Aug 19, 2022
5c70268
Revert "eth/fetcher: don't spend too much time on transaction inclusi…
karalabe Aug 22, 2022
bb45a27
eth/catalyst: warn less frequently if no beacon client is available (…
karalabe Aug 22, 2022
4468d7d
params: release go-ethereum v1.10.22
fjl Aug 22, 2022
43b1ded
params: begin v1.10.23 release cycle
fjl Aug 22, 2022
1a7bc50
core, eth/downloader: handle spurious junk bodies from racey rollback…
karalabe Aug 23, 2022
a872dad
core/state, trie: fix trie flush order for proper pruning
karalabe Aug 23, 2022
104a41e
consensus/beacon: don't ignore errors
holiman Aug 23, 2022
75aa785
params: release Geth v1.10.23
karalabe Aug 24, 2022
dd0c952
graphql: return correct logs for tx (#25612)
s1na Aug 31, 2022
51674c4
graphql: fixes missing tx logs (#25745)
s1na Sep 13, 2022
621760a
Release Geth v1.10.24
karalabe Sep 14, 2022
be8759b
params: set TerminalTotalDifficultyPassed to true (#25769)
MariusVanDerWijden Sep 15, 2022
5b69c54
params: release Geth v1.10.25
karalabe Sep 15, 2022
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
  •  
  •  
  •  
53 changes: 38 additions & 15 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,55 @@ linters:
- govet
- ineffassign
- misspell
# - staticcheck
- unconvert
# - unused
- varcheck
- typecheck
- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
- gosec
- whitespace

# - structcheck # lots of false positives
# - errcheck #lot of false positives
# - contextcheck
# - errchkjson # lots of false positives
# - errorlint # this check crashes
# - exhaustive # silly check
# - makezero # false positives
# - nilerr # several intentional

linters-settings:
gofmt:
simplify: true
goconst:
min-len: 3 # minimum length of string constant
min-occurrences: 6 # minimum number of occurrences
gosec:
excludes:
- G404 # Use of weak random number generator - lots of FP
- G107 # Potential http request -- those are intentional
- G306 # G306: Expect WriteFile permissions to be 0600 or less

issues:
exclude-rules:
- path: crypto/blake2b/
linters:
- deadcode
- path: crypto/bn256/cloudflare
linters:
- deadcode
- path: p2p/discv5/
linters:
- deadcode
- path: core/vm/instructions_test.go
linters:
- goconst
- path: cmd/faucet/
- path: crypto/bn256/cloudflare/optate.go
linters:
- deadcode
- staticcheck
- path: internal/build/pgp.go
text: 'SA1019: package golang.org/x/crypto/openpgp is deprecated'
- path: core/vm/contracts.go
text: 'SA1019: package golang.org/x/crypto/ripemd160 is deprecated'
- path: accounts/usbwallet/trezor.go
text: 'SA1019: package github.com/golang/protobuf/proto is deprecated'
- path: accounts/usbwallet/trezor/
text: 'SA1019: package github.com/golang/protobuf/proto is deprecated'
exclude:
- 'SA1019: event.TypeMux is deprecated: use Feed'
- 'SA1019: strings.Title is deprecated'
- 'SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.'
- 'SA1029: should not use built-in type string as key for value'
- 'G306: Expect WriteFile permissions to be 0600 or less'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download

ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install ./cmd/geth
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth

# Pull Geth into a second stage deploy alpine container
FROM alpine:latest
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download

ADD . /go-ethereum
RUN cd /go-ethereum && go run build/ci.go install
RUN cd /go-ethereum && go run build/ci.go install -static

# Pull all binaries into a second stage deploy alpine container
FROM alpine:latest
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ directory.
| `abigen` | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain [Ethereum contract ABIs](https://docs.soliditylang.org/en/develop/abi-spec.html) with expanded functionality if the contract bytecode is also available. However, it also accepts Solidity source files, making development much more streamlined. Please see our [Native DApps](https://geth.ethereum.org/docs/dapp/native-bindings) page for details. |
| `bootnode` | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. |
| `evm` | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. `evm --code 60ff60ff --debug run`). |
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://eth.wiki/en/fundamentals/rlp)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
| `rlpdump` | Developer utility tool to convert binary RLP ([Recursive Length Prefix](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp)) dumps (data encoding used by the Ethereum protocol both network as well as consensus wise) to user-friendlier hierarchical representation (e.g. `rlpdump --hex CE0183FFFFFFC4C304050583616263`). |
| `puppeth` | a CLI wizard that aids in creating a new Ethereum network. |

## Running `geth`
Expand Down Expand Up @@ -188,7 +188,7 @@ accessible from the outside.

As a developer, sooner rather than later you'll want to start interacting with `geth` and the
Ethereum network via your own programs and not manually through the console. To aid
this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://eth.wiki/json-rpc/API)
this, `geth` has built-in support for a JSON-RPC based APIs ([standard APIs](https://ethereum.github.io/execution-apis/api-documentation/)
and [`geth` specific APIs](https://geth.ethereum.org/docs/rpc/server)).
These can be exposed via HTTP, WebSockets and IPC (UNIX sockets on UNIX based
platforms, and named pipes on Windows).
Expand All @@ -211,7 +211,7 @@ HTTP based JSON-RPC API options:
* `--ws.api` API's offered over the WS-RPC interface (default: `eth,net,web3`)
* `--ws.origins` Origins from which to accept websockets requests
* `--ipcdisable` Disable the IPC-RPC server
* `--ipcapi` API's offered over the IPC-RPC interface (default: `admin,debug,eth,miner,net,personal,shh,txpool,web3`)
* `--ipcapi` API's offered over the IPC-RPC interface (default: `admin,debug,eth,miner,net,personal,txpool,web3`)
* `--ipcpath` Filename for IPC socket/pipe within the datadir (explicit paths escape it)

You'll need to use your own programming environments' capabilities (libraries, tools, etc) to
Expand Down Expand Up @@ -297,7 +297,7 @@ $ bootnode --genkey=boot.key
$ bootnode --nodekey=boot.key
```

With the bootnode online, it will display an [`enode` URL](https://eth.wiki/en/fundamentals/enode-url-format)
With the bootnode online, it will display an [`enode` URL](https://ethereum.org/en/developers/docs/networking-layer/network-addresses/#enode)
that other nodes can use to connect to it and exchange peer information. Make sure to
replace the displayed IP address information (most probably `[::]`) with your externally
accessible IP to get the actual `enode` URL.
Expand Down
25 changes: 5 additions & 20 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (abi ABI) getArguments(name string, data []byte) (Arguments, error) {
args = event.Inputs
}
if args == nil {
return nil, errors.New("abi: could not locate named method or event")
return nil, fmt.Errorf("abi: could not locate named method or event: %s", name)
}
return args, nil
}
Expand Down Expand Up @@ -164,7 +164,7 @@ func (abi *ABI) UnmarshalJSON(data []byte) error {
case "constructor":
abi.Constructor = NewMethod("", "", Constructor, field.StateMutability, field.Constant, field.Payable, field.Inputs, nil)
case "function":
name := overloadedName(field.Name, func(s string) bool { _, ok := abi.Methods[s]; return ok })
name := ResolveNameConflict(field.Name, func(s string) bool { _, ok := abi.Methods[s]; return ok })
abi.Methods[name] = NewMethod(name, field.Name, Function, field.StateMutability, field.Constant, field.Payable, field.Inputs, field.Outputs)
case "fallback":
// New introduced function type in v0.6.0, check more detail
Expand All @@ -184,9 +184,11 @@ func (abi *ABI) UnmarshalJSON(data []byte) error {
}
abi.Receive = NewMethod("", "", Receive, field.StateMutability, field.Constant, field.Payable, nil, nil)
case "event":
name := overloadedName(field.Name, func(s string) bool { _, ok := abi.Events[s]; return ok })
name := ResolveNameConflict(field.Name, func(s string) bool { _, ok := abi.Events[s]; return ok })
abi.Events[name] = NewEvent(name, field.Name, field.Anonymous, field.Inputs)
case "error":
// Errors cannot be overloaded or overridden but are inherited,
// no need to resolve the name conflict here.
abi.Errors[field.Name] = NewError(field.Name, field.Inputs)
default:
return fmt.Errorf("abi: could not recognize type %v of field %v", field.Type, field.Name)
Expand Down Expand Up @@ -251,20 +253,3 @@ func UnpackRevert(data []byte) (string, error) {
}
return unpacked[0].(string), nil
}

// overloadedName returns the next available name for a given thing.
// Needed since solidity allows for overloading.
//
// e.g. if the abi contains Methods send, send1
// overloadedName would return send2 for input send.
//
// overloadedName works for methods, events and errors.
func overloadedName(rawName string, isAvail func(string) bool) string {
name := rawName
ok := isAvail(name)
for idx := 0; ok; idx++ {
name = fmt.Sprintf("%s%d", rawName, idx)
ok = isAvail(name)
}
return name
}
4 changes: 1 addition & 3 deletions accounts/abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1038,9 +1038,7 @@ func TestABI_EventById(t *testing.T) {
}
if event == nil {
t.Errorf("We should find a event for topic %s, test #%d", topicID.Hex(), testnum)
}

if event.ID != topicID {
} else if event.ID != topicID {
t.Errorf("Event id %s does not match topic %s, test #%d", event.ID.Hex(), topicID.Hex(), testnum)
}

Expand Down
9 changes: 5 additions & 4 deletions accounts/abi/argument.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package abi

import (
"encoding/json"
"errors"
"fmt"
"reflect"
"strings"
Expand Down Expand Up @@ -79,7 +80,7 @@ func (arguments Arguments) isTuple() bool {
func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
if len(data) == 0 {
if len(arguments.NonIndexed()) != 0 {
return nil, fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
return nil, errors.New("abi: attempting to unmarshall an empty string while arguments are expected")
}
return make([]interface{}, 0), nil
}
Expand All @@ -90,11 +91,11 @@ func (arguments Arguments) Unpack(data []byte) ([]interface{}, error) {
func (arguments Arguments) UnpackIntoMap(v map[string]interface{}, data []byte) error {
// Make sure map is not nil
if v == nil {
return fmt.Errorf("abi: cannot unpack into a nil map")
return errors.New("abi: cannot unpack into a nil map")
}
if len(data) == 0 {
if len(arguments.NonIndexed()) != 0 {
return fmt.Errorf("abi: attempting to unmarshall an empty string while arguments are expected")
return errors.New("abi: attempting to unmarshall an empty string while arguments are expected")
}
return nil // Nothing to unmarshal, return
}
Expand All @@ -116,7 +117,7 @@ func (arguments Arguments) Copy(v interface{}, values []interface{}) error {
}
if len(values) == 0 {
if len(arguments.NonIndexed()) != 0 {
return fmt.Errorf("abi: attempting to copy no values while arguments are expected")
return errors.New("abi: attempting to copy no values while arguments are expected")
}
return nil // Nothing to copy, return
}
Expand Down
52 changes: 29 additions & 23 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ type SimulatedBackend struct {
stuckTransactions types.Transactions // holds onto all txes that don't go into the pending block due to low gas
pendingBlock *types.Block // Currently pending block that will be imported on request
pendingState *state.StateDB // Currently pending state that will be the active on request
pendingReceipts types.Receipts // Currently receipts for the pending block

events *filters.EventSystem // Event system for filtering log events live
events *filters.EventSystem // for filtering log events live
filterSystem *filters.FilterSystem // for filtering database logs

config *params.ChainConfig

Expand All @@ -87,8 +89,12 @@ func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.Genesis
database: database,
blockchain: blockchain,
config: genesis.Config,
events: filters.NewEventSystem(&filterBackend{database, blockchain}, false),
}

filterBackend := &filterBackend{database, blockchain, backend}
backend.filterSystem = filters.NewFilterSystem(filterBackend, filters.Config{})
backend.events = filters.NewEventSystem(backend.filterSystem, false)

backend.rollback(blockchain.CurrentBlock())
return backend
}
Expand All @@ -108,7 +114,7 @@ func (b *SimulatedBackend) Close() error {

// Commit imports all the pending transactions as a single block and starts a
// fresh new state.
func (b *SimulatedBackend) Commit() {
func (b *SimulatedBackend) Commit() common.Hash {
b.mu.Lock()
defer b.mu.Unlock()

Expand All @@ -130,10 +136,14 @@ func (b *SimulatedBackend) Commit() {
if _, err := b.blockchain.InsertChain([]*types.Block{blocks[0]}); err != nil {
panic(err) // This cannot happen unless the simulator is wrong, fail in that case
}
blockHash := b.pendingBlock.Hash()

// Using the last inserted block here makes it possible to build on a side
// chain after a fork.
b.stuckTransactions = remainingTx
b.rollback(blocks[0])

return blockHash
}

// Rollback aborts all pending transactions, reverting to the last committed state.
Expand Down Expand Up @@ -631,7 +641,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
// User specified the legacy gas field, convert to 1559 gas typing
call.GasFeeCap, call.GasTipCap = call.GasPrice, call.GasPrice
} else {
// User specified 1559 gas feilds (or none), use those
// User specified 1559 gas fields (or none), use those
if call.GasFeeCap == nil {
call.GasFeeCap = new(big.Int)
}
Expand Down Expand Up @@ -690,7 +700,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
}
var remainingTxes types.Transactions
// Include tx in chain
blocks, _ := core.GenerateChain(b.config, block, ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
blocks, receipts := core.GenerateChain(b.config, block, ethash.NewFaker(), b.database, 1, func(number int, block *core.BlockGen) {
for _, tx := range b.pendingBlock.Transactions() {
// if market gas price is not set or tx gas price is lower than the set market gas price
if b.marketGasPrice == nil || b.marketGasPrice.Cmp(tx.GasPrice()) <= 0 {
Expand All @@ -711,6 +721,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
b.pendingBlock = blocks[0]
b.pendingState, _ = state.New(b.pendingBlock.Root(), stateDB.Database(), nil)
b.stuckTransactions = remainingTxes
b.pendingReceipts = receipts[0]

return nil
}
Expand All @@ -723,7 +734,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
var filter *filters.Filter
if query.BlockHash != nil {
// Block filter requested, construct a single-shot filter
filter = filters.NewBlockFilter(&filterBackend{b.database, b.blockchain}, *query.BlockHash, query.Addresses, query.Topics)
filter = b.filterSystem.NewBlockFilter(*query.BlockHash, query.Addresses, query.Topics)
} else {
// Initialize unset filter boundaries to run from genesis to chain head
from := int64(0)
Expand All @@ -735,7 +746,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
to = query.ToBlock.Int64()
}
// Construct the range filter
filter = filters.NewRangeFilter(&filterBackend{b.database, b.blockchain}, from, to, query.Addresses, query.Topics)
filter = b.filterSystem.NewRangeFilter(from, to, query.Addresses, query.Topics)
}
// Run the filter and return all the logs
logs, err := filter.Logs(ctx)
Expand Down Expand Up @@ -856,11 +867,13 @@ func (m callMsg) AccessList() types.AccessList { return m.CallMsg.AccessList }
// filterBackend implements filters.Backend to support filtering for logs without
// taking bloom-bits acceleration structures into account.
type filterBackend struct {
db ethdb.Database
bc *core.BlockChain
db ethdb.Database
bc *core.BlockChain
backend *SimulatedBackend
}

func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }

func (fb *filterBackend) EventMux() *event.TypeMux { panic("not supported") }

func (fb *filterBackend) HeaderByNumber(ctx context.Context, block rpc.BlockNumber) (*types.Header, error) {
Expand All @@ -874,6 +887,10 @@ func (fb *filterBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*t
return fb.bc.GetHeaderByHash(hash), nil
}

func (fb *filterBackend) PendingBlockAndReceipts() (*types.Block, types.Receipts) {
return fb.backend.pendingBlock, fb.backend.pendingReceipts
}

func (fb *filterBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) {
number := rawdb.ReadHeaderNumber(fb.db, hash)
if number == nil {
Expand All @@ -882,19 +899,8 @@ func (fb *filterBackend) GetReceipts(ctx context.Context, hash common.Hash) (typ
return rawdb.ReadReceipts(fb.db, hash, *number, fb.bc.Config()), nil
}

func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) {
number := rawdb.ReadHeaderNumber(fb.db, hash)
if number == nil {
return nil, nil
}
receipts := rawdb.ReadReceipts(fb.db, hash, *number, fb.bc.Config())
if receipts == nil {
return nil, nil
}
logs := make([][]*types.Log, len(receipts))
for i, receipt := range receipts {
logs[i] = receipt.Logs
}
func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error) {
logs := rawdb.ReadLogs(fb.db, hash, number, fb.bc.Config())
return logs, nil
}

Expand Down
Loading