Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
41408af
version: begin v1.16.2 release cycle
fjl Jul 2, 2025
b4979f7
beacon/blsync: update logs for blsync (Fixes #31968 ) (#32046)
shazam8253 Jul 2, 2025
6eb212b
cmd/workload: rework tracegen to run tracing at block level (#32092)
rjl493456442 Jul 2, 2025
34f00a4
core/state: add GetStateAndCommittedState (#31585)
MariusVanDerWijden Jul 3, 2025
97645ca
cmd/utils, internal/debug: hide the deprecated flags (#32128)
DanialZhouMAX Jul 3, 2025
ef6e92e
.gitea: add windows build (experimental)
fjl Jul 3, 2025
f786b2a
cmd/utils: show full deprecated flags (#32141)
DanialZhouMAX Jul 4, 2025
dd7d144
cmd/utils: update flag description of gcmode (#32145)
rjl493456442 Jul 4, 2025
7088e87
.gitea: add workflow_dispatch for release build
fjl Jul 4, 2025
e225983
.gitea: update PATH
fjl Jul 4, 2025
3f4555a
.gitea: set PATH
fjl Jul 4, 2025
db1806e
gitea: try with cmd
fjl Jul 4, 2025
9efe1c1
gitea: set PATH in script
fjl Jul 4, 2025
0630338
.gitea: fix typo in windows workflow
fjl Jul 4, 2025
bdf47f4
core/vm: move nil-check out of the interpreter loop (#32068)
omerfirmak Jul 7, 2025
90c6197
core/vm: implement EIP-7939 - CLZ opcode (#31989)
Giulio2002 Jul 7, 2025
f0741e6
core/txpool/blobpool: lower log level for warnings (#32142)
mask-pp Jul 7, 2025
84f2932
.github, internal/flags: improve actions test runs (#32150)
fjl Jul 7, 2025
ffb4e6f
consensus/misc/eip4844: implement EIP-7918 (#31965)
s1na Jul 7, 2025
b3131f0
core/vm: implement EIP-7951 - precompile for secp256r1 (#31991)
fjl Jul 7, 2025
e71487b
cmd, eth/catalyst: exit geth only if exitWhenSynced is specified (#32…
rjl493456442 Jul 8, 2025
43832e6
eth/catalyst: abort dev mode block commit if shut down is triggered …
jwasinger Jul 8, 2025
1cbcebc
miner, core, core/txpool: implement EIP 7825 - TX Gas Limit Cap (#31824)
jwasinger Jul 8, 2025
efbba96
core/vm: update gas cost of CLZ to five (#32172)
fjl Jul 9, 2025
e6b9d0c
core,miner: implement EIP-7934 - RLP Execution Block Size Limit (#31990)
jwasinger Jul 9, 2025
bd5b55e
cmd/utils: add the missing check for the HoodiFlag in blsync (#32179)
mask-pp Jul 9, 2025
355228b
cmd/clef: update Safe API documentation links in changelog (#32136)
Daulox92 Jul 9, 2025
1ef3bca
core/types: add block-level access list structures with encoding/dec…
jwasinger Jul 11, 2025
0713725
eth/downloader: fix ancient limit in snap sync (#32188)
rjl493456442 Jul 11, 2025
8cf87c6
.github: remove karalabe from CODEOWNERS
fjl Jul 11, 2025
b992b10
cmd/geth: update vcheck testdata, add docs on generating signatures (…
PixelPil0t1 Jul 11, 2025
055e1e6
signer/core/apitypes: require blob txs to have tx.to set (#32197)
mask-pp Jul 14, 2025
a9061cf
accounts/keystore: update links to documenation (#32194)
kilavvy Jul 14, 2025
90a0989
ethclient/gethclient: remove race condition in tests (#32206)
MariusVanDerWijden Jul 14, 2025
a327ffe
params: EIP-7892 - Blob Parameter Only Hardforks (#32193)
fjl Jul 14, 2025
e9e12a9
eth/fetcher: fix announcement drop logic (#32210)
healthykim Jul 14, 2025
1a5f399
miner: set sidecar version when recomputing proofs (#32199)
mask-pp Jul 14, 2025
5bce990
all: fix outdated ethereum wiki json-rpc json-rpc doc links (#32209)
zeevick10 Jul 14, 2025
fe0ae06
core/types: fix CellProofsAt method (#32198)
mask-pp Jul 15, 2025
17903fe
triedb/pathdb: introduce file-based state journal (#32060)
jsvisa Jul 15, 2025
7364e63
core/rawdb: change the mechanism to schedule freezer sync (#32135)
rjl493456442 Jul 15, 2025
d7db10d
eth/protocols/snap, p2p/discover: improve zero time checks (#32214)
asamuj Jul 15, 2025
7fcb796
all: update dead wiki links (#32215)
maximevtush Jul 15, 2025
e94123a
core/rawdb: reduce allocations in rawdb.ReadHeaderNumber (#31913)
MariusVanDerWijden Jul 15, 2025
61d7279
trie: avoid spawning goroutines for empty children (#32220)
omerfirmak Jul 16, 2025
532a1c2
eth/downloader: improve nil pointer protection (#32222)
CertiK-Geth Jul 16, 2025
66df1f2
account/abi/bind/v2: fix TestDeploymentWithOverrides (#32212)
stevemilk Jul 16, 2025
30e3a49
eth/tracers: apply block header overrides correctly (#32183)
shazam8253 Jul 16, 2025
f36d349
triedb/pathdb: avoid duplicate metadata reads (#32226)
jsvisa Jul 17, 2025
becca46
eth/protocols/snap: fix negative eta in state progress logging (#32225)
DanialZhouMAX Jul 17, 2025
a487729
triedb/pathdb: improve the performance of parse index block (#32219)
jsvisa Jul 17, 2025
0dacfef
all: define constructor for BlobSidecar (#32213)
rjl493456442 Jul 17, 2025
b4b4068
params: update tx gas limit cap (#32230)
MariusVanDerWijden Jul 18, 2025
f17df6d
core/txpool/blobpool: remove unused `txValidationFn` from BlobPool (#…
Kourin1996 Jul 18, 2025
f37fe67
triedb/pathdb: fix incorrect address length in history searching (#32…
jsvisa Jul 21, 2025
d80094f
core/vm: triple modexp cost post-cancun (#32231)
MariusVanDerWijden Jul 21, 2025
f96f82b
core, params: add limit for max blobs in blob transaction (#32246)
fjl Jul 21, 2025
36c87a2
build: update tests to fusaka-devnet-3 (#32251)
fjl Jul 21, 2025
b2a0e08
core/types: minimize this invalid intermediate state (#32241)
mask-pp Jul 22, 2025
83aa643
core/rawdb: downgrade log level in chain freezer (#32253)
mask-pp Jul 22, 2025
264c06a
triedb/pathdb: use binary.append to eliminate the tmp scratch slice …
jsvisa Jul 22, 2025
a7efdcb
p2p/rlpx: optimize XOR operation using bitutil.XORBytes (#32217)
reallesee Jul 22, 2025
3b67602
eth/gasestimator: fix potential overflow (#32255)
gzeoneth Jul 23, 2025
16117eb
triedb/pathdb: fix an deadlock in history indexer (#32260)
jsvisa Jul 23, 2025
b369a85
eth/protocols/snap: add healing and syncing metrics (#32258)
MariusVanDerWijden Jul 24, 2025
29eebb5
core: replace the empty fmt.Errorf with errors.New (#32274)
nthumann Jul 28, 2025
0fe1bc0
eth/catalyst: fix error message in ExecuteStatelessPayloadV4 (#32269)
Galoretka Jul 28, 2025
a7aed7b
cmd, eth, internal: introduce debug_sync (#32177)
rjl493456442 Jul 28, 2025
32d537c
all: replace fmt.Errorf with errors.New (#32286)
ericxtheodore Jul 28, 2025
b64a500
downloader: fix typos, grammar and formatting (#32288)
tomasandroil Jul 28, 2025
eb7aef4
ethclient/simulated: Fix flaky rollback test (#32280)
Jul 28, 2025
a56558d
core/state: preallocate capacity for logs list (#32291)
mask-pp Jul 29, 2025
d14d4d2
core/state: improve PrettyPrint function (#32293)
ericxtheodore Jul 30, 2025
2d95ba7
core/types: expose sigHash as Hash for SetCodeAuthorization (#32298)
dkatzan Jul 31, 2025
0814d99
common/hexutil: replace customized bit sizer with bit.Uintsize (#32304)
cuiweixie Jul 31, 2025
4d9d728
accounts/abi: precompile regex (#32301)
cuiweixie Jul 31, 2025
d4a3bf1
cmd/devp2p/internal/v4test: add test for ENRRequest (#32303)
fjl Jul 31, 2025
23da91f
trie: reduce the memory allocation in trie hashing (#31902)
rjl493456442 Aug 1, 2025
17d65e9
core/vm: add configurable jumpdest analysis cache (#32143)
lmittmann Aug 1, 2025
9c58810
eth: fix typos and outdated comments (#32324)
tomasandroil Aug 1, 2025
038ff76
eth/filters: fix error when blockHash is used with fromBlock/toBlock …
ceyonur Aug 1, 2025
5572f2e
rlp/rlpgen: implement package renaming support (#31148)
VolodymyrBg Aug 1, 2025
5ebd803
beacon/params, core/filtermaps: update checkpoints (#32336)
zsfelfoldi Aug 4, 2025
dd1ebac
version: release v1.16.2 (#32343)
rjl493456442 Aug 4, 2025
073e7ec
version: begin v1.16.3 release cycle (#32345)
rjl493456442 Aug 4, 2025
cf50026
core/state: introduce the TransitionState object (verkle transition p…
gballet Aug 5, 2025
e9dca3b
eth/catalyst: avoid load the same blob tx multi times (#32190)
mask-pp Aug 5, 2025
59405c4
eth/gasestimator: check ErrGasLimitTooHigh conditions (#32348)
mininny Aug 5, 2025
792de5d
core/filtermaps: remove unnecessary nil check and add cv2 lock (#32309)
cuiweixie Aug 6, 2025
e7189b5
go.mod: upgraded github.com/golang-jwt/jwt/v4 v4.5.1 => v4.5.2 (#32356)
cuiweixie Aug 7, 2025
f49f3ec
rpc: use reflect.TypeFor (#32316)
cuiweixie Aug 7, 2025
dfde155
crypto/kzg4844: use reflect.TypeFor (#32319)
cuiweixie Aug 7, 2025
ec97ac7
common, common/hexutil: use reflect.TypeFor (#32321)
cuiweixie Aug 7, 2025
2e3971a
beacon/merkle: use reflect.TypeFor (#32322)
cuiweixie Aug 7, 2025
f9f85d0
core: use reflect.TypeFor (#32320)
cuiweixie Aug 7, 2025
e979438
p2p/enode: use atomic.Pointer in LocalNode (#32360)
cuiweixie Aug 7, 2025
bd6797e
signer/core/apitypes: simplify reflect []byte creation (#32315)
cuiweixie Aug 7, 2025
4e7bc2b
rlp: use reflect.TypeFor (#32317)
cuiweixie Aug 7, 2025
f86870f
eth/downloader: fix incomplete code comment (#32354)
radik878 Aug 7, 2025
888b71b
metrics: use atomic.Pointer in runtimeHistogram (#32361)
cuiweixie Aug 7, 2025
c3ef6c7
core/vm: fold EVMInterpreter into EVM (#32352)
omerfirmak Aug 7, 2025
8ba1c79
ethclient: fix flaky pending tx test (#32380)
kashitaka Aug 11, 2025
18b4ee5
ethdb/leveldb: check iterator error in Database.DeleteRange (#32384)
MozirDmitriy Aug 11, 2025
40072af
core/vm: make types consistent in makeDup (#32378)
cuiweixie Aug 11, 2025
6238eff
miner: remove todo comment (#32389)
cuiweixie Aug 11, 2025
2485d09
downloader: fix comment (#32382)
sashass1315 Aug 11, 2025
92106a6
accounts/abi, accounts/keystore: use reflect.TypeFor (#32323)
cuiweixie Aug 11, 2025
55a471e
eth/downloader: skip nil peer in GetHeader (#32369)
Forostovec Aug 11, 2025
cbbf686
trie, core: rework tracer and track origin value of dirty nodes (#32306)
rjl493456442 Aug 11, 2025
2e9c9b5
consensus: fix ambiguous invalid gas limit error (#32405)
rizkyikiw42 Aug 12, 2025
43b2aac
trie: refactor to use slices.Concat (#32401)
cuiweixie Aug 12, 2025
56edd21
cmd: fix inconsistent function name in comment (#32411)
youzichuan Aug 12, 2025
75fc56f
eth: abort `requiredBlocks` check if peer handler terminated (#32413)
klim0v Aug 13, 2025
a4d3fb9
node: remove unused err var (#32398)
cuiweixie Aug 13, 2025
f054bef
rlp: optimize intsize (#32421)
cuiweixie Aug 13, 2025
5134213
eth/tracers: Adds codeHash to prestateTracer's response (#32391)
nebojsa94 Aug 13, 2025
3ff99ae
eth/syncer: fix typo (#32427)
MariusVanDerWijden Aug 13, 2025
2b38daa
p2p: refactor to use time.Now().UnixMilli() in golang std lib (#32402)
cuiweixie Aug 14, 2025
b00b6fe
.github: upgrade workflows to Go 1.25 (#32425)
fjl Aug 14, 2025
25cce4d
build: upgrade -dlgo version to Go 1.25.0 (#32412)
levisyin Aug 14, 2025
e798e26
crypto/secp256k1: use ReadBits from common/math (#32430)
cuiweixie Aug 14, 2025
2dbb580
build: remove unused functions (#32393)
cuiweixie Aug 14, 2025
ea3a717
trie, core/state: add the transition tree (verkle transition part 2) …
gballet Aug 15, 2025
a002a6c
cmd/evm: use PathScheme in blockrunner (#32444)
gballet Aug 15, 2025
ccf684f
core/vm: refactor to use bitutil.TestBytes (#32434)
cuiweixie Aug 15, 2025
88922d2
crypto/bn256: refactor to use bitutil.TestBytes (#32435)
cuiweixie Aug 15, 2025
1d29e3e
consensus/misc/eip4844: use blob parameters of current header (#32424)
fjl Aug 15, 2025
1693a48
rlp: remove workaround for Value.Bytes (#32433)
fjl Aug 15, 2025
a9a19c4
core/vm: fix EIP-7823 modexp input length check (#32363)
jwasinger Aug 15, 2025
85077be
metrics: add tinygo build flag for CPU time (#32454)
kevaundray Aug 18, 2025
5b2fc67
core/rawdb: add non-unix alternative for tablewriter (#32455)
kevaundray Aug 18, 2025
7cc0137
eth/syncer: stop ticker to prevent resource leak (#32443)
phrwlk Aug 19, 2025
42bf484
core/rawdb: enhance database key construction (#32431)
cuiweixie Aug 19, 2025
d93f820
rpc: add SetWebsocketReadLimit in Server (#32279)
yzang2019 Aug 19, 2025
d99143d
CODEOWNERS: add gballet as the owner of trie package (#32466)
gballet Aug 19, 2025
dffa1f5
ethclient/gethclient: use common.Hash to debug_traceTransaction (#32404)
Fibonacci747 Aug 19, 2025
1c74f23
graphql: add query depth limit to prevent DoS attacks (#32344)
grandchildrice Aug 19, 2025
62ac0e0
p2p: update MaxPeers comment (#32414)
klim0v Aug 19, 2025
7d4852b
eth/catalyst: return methods by reflect (#32300)
mask-pp Aug 19, 2025
9ce40d1
internal/ethapi, miner: fix GetBlockReceipts for pending (#32461)
rjl493456442 Aug 20, 2025
bf8f63d
trie, core/state: introduce trie Prefetch for optimizing preload (#32…
rjl493456442 Aug 20, 2025
997dff4
p2p: using math.MaxInt32 from go std lib (#32357)
cuiweixie Aug 20, 2025
44fc0c8
rlp: refactor to use maths.ReadBits (#32432)
cuiweixie Aug 21, 2025
39ab721
fixes missing protection of nil pointer dereference in scwallet (#32186)
KapilSareen Aug 21, 2025
94ecd1d
accounts/usbwallet: correct version comparison logic (#32417)
rizkyikiw42 Aug 21, 2025
f3467d1
p2p: remove todo comment, as it's unnecessary (#32397)
cuiweixie Aug 21, 2025
10421ed
core/types: reduce allocations for transaction comparison (#31912)
MariusVanDerWijden Aug 22, 2025
ac17319
triedb/pathdb: improve err message in historical state reader (#32477)
rjl493456442 Aug 22, 2025
e965623
core, miner, trie: add metrics tracking state trie depth (#32388)
shazam8253 Aug 22, 2025
276ed48
p2p/discover: add discv5 invalid findnodes result test cases (#32481)
vipocenka Aug 22, 2025
f62eec9
node: fix vhosts for adminAPI (#32488)
ericxtheodore Aug 25, 2025
d0602ba
core,trie: fix typo in TransitionTrie (#32491)
pxwanglu Aug 25, 2025
a9ac275
.github/workflows: naive PR format checker (#32480)
gballet Aug 25, 2025
9b2e8e7
p2p: use slices.Clone (#32428)
cuiweixie Aug 25, 2025
42467f1
params: fix history serve window for verkle test (#32127)
Thegaram Aug 25, 2025
7a87d8a
eth/tracers: add missing teardown in TestTraceChain (#32472)
Snezhkko Aug 25, 2025
16bd164
internal/web3ext: remove deprecated method debug_seedHash (#32495)
gzliudan Aug 26, 2025
8c58f49
triedb/pathdb: rename history to state history (#32498)
rjl493456442 Aug 26, 2025
27d4a10
build: add support for ubuntu 25.04 (#31666)
ericxtheodore Aug 26, 2025
514322c
cmd: fix typo in comment (#32501)
tzchenxixi Aug 26, 2025
f877183
eth/tracers: fix supply tracer uncle accounting (#31882)
sjb933 Aug 26, 2025
95ab643
triedb/pathdb: refactor state history write (#32497)
rjl493456442 Aug 26, 2025
eab5c92
rpc: refactor read limit test (#32494)
lightclient Aug 26, 2025
6191f31
eth: replace hardcoded sleep with polling loop in snap sync test (#32…
avorylli Aug 27, 2025
7db6c91
internal/ethapi: fix precompile override for eth_estimateGas (#31795)
MonkeyMarcel Aug 27, 2025
52ec2b5
accounts/abi: fix panic when check event with log has empty or nil to…
nthumann Aug 27, 2025
f90eb3e
core, internal, miner, signer: convert legacy sidecar in Osaka fork (…
rjl493456442 Aug 27, 2025
e67761e
eth/tracers: fix testcase 7702_delegate (#32349)
allformless Aug 27, 2025
3a89051
node: fix problematic function name in comment (#32510)
slicesequal Aug 28, 2025
9af1f71
eth: stabilize tx relay peer selection (#31714)
cskiraly Aug 28, 2025
0979c6a
core: improve error context in state processor for Prague EIPs (#32509)
oooLowNeoNooo Aug 28, 2025
2a795c1
all: fix problematic function name in comment (#32513)
zach871 Aug 29, 2025
7f78fa6
triedb/pathdb, core: keep root->id mappings after truncation (#32502)
rjl493456442 Aug 29, 2025
3aeccad
README: add twitter badge to documentation (#32516)
operagxoksana Aug 29, 2025
0cde527
core/rawdb: inspect database in parallel (#32506)
jsvisa Sep 1, 2025
0e69530
all: improve ETA calculation across all progress indicators (#32521)
Jolly23 Sep 1, 2025
931befe
core/stateless: only report leaf depth in witness stats (#32507)
gballet Sep 1, 2025
bd4b179
trie/bintrie: add eip7864 binary trees and run its tests (#32365)
gballet Sep 1, 2025
ffe758c
internal/ethapi,params: add `eth_config` (#32239)
lightclient Sep 1, 2025
d818a9a
version: release v1.16.3
gballet Sep 1, 2025
da32749
Merge branch 'geth-v-1-16-3' into merge-geth-v-1-16-3
allformless Dec 18, 2025
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
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ eth/tracers/ @s1na
ethclient/ @fjl
ethdb/ @rjl493456442
event/ @fjl
trie/ @rjl493456442
trie/ @rjl493456442 @gballet
triedb/ @rjl493456442
core/tracing/ @s1na
graphql/ @s1na
Expand All @@ -29,5 +29,5 @@ miner/ @MariusVanDerWijden @fjl @rjl493456442
node/ @fjl
p2p/ @fjl @zsfelfoldi
rlp/ @fjl
params/ @fjl @karalabe @gballet @rjl493456442 @zsfelfoldi
params/ @fjl @gballet @rjl493456442 @zsfelfoldi
rpc/ @fjl
23 changes: 23 additions & 0 deletions .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PR Format Validation

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
validate-pr:
runs-on: ubuntu-latest
steps:
- name: Check PR Title Format
uses: actions/github-script@v7
with:
script: |
const prTitle = context.payload.pull_request.title;
const titleRegex = /^(\.?[\w\s,{}/]+): .+/;
if (!titleRegex.test(prTitle)) {
core.setFailed(`PR title "${prTitle}" does not match required format: directory, ...: description`);
return;
}
console.log('✅ PR title format is valid');
6 changes: 5 additions & 1 deletion accounts/abi/abigen/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ import (
"github.com/ethereum/go-ethereum/log"
)

var (
intRegex = regexp.MustCompile(`(u)?int([0-9]*)`)
)

func isKeyWord(arg string) bool {
switch arg {
case "break":
Expand Down Expand Up @@ -299,7 +303,7 @@ func bindBasicType(kind abi.Type) string {
case abi.AddressTy:
return "common.Address"
case abi.IntTy, abi.UintTy:
parts := regexp.MustCompile(`(u)?int([0-9]*)`).FindStringSubmatch(kind.String())
parts := intRegex.FindStringSubmatch(kind.String())
switch parts[2] {
case "8", "16", "32", "64":
return fmt.Sprintf("%sint%s", parts[1], parts[2])
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abigen/source2.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ var (
// Solidity: {{.Original.String}}
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}Event(log *types.Log) (*{{$contract.Type}}{{.Normalized.Name}}, error) {
event := "{{.Original.Name}}"
if log.Topics[0] != {{ decapitalise $contract.Type}}.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != {{ decapitalise $contract.Type}}.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new({{$contract.Type}}{{.Normalized.Name}})
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abigen/testdata/v2/crowdsale.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (CrowdsaleFundTransfer) ContractEventName() string {
// Solidity: event FundTransfer(address backer, uint256 amount, bool isContribution)
func (crowdsale *Crowdsale) UnpackFundTransferEvent(log *types.Log) (*CrowdsaleFundTransfer, error) {
event := "FundTransfer"
if log.Topics[0] != crowdsale.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != crowdsale.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(CrowdsaleFundTransfer)
Expand Down
10 changes: 5 additions & 5 deletions accounts/abi/abigen/testdata/v2/dao.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ func (DAOChangeOfRules) ContractEventName() string {
// Solidity: event ChangeOfRules(uint256 minimumQuorum, uint256 debatingPeriodInMinutes, int256 majorityMargin)
func (dAO *DAO) UnpackChangeOfRulesEvent(log *types.Log) (*DAOChangeOfRules, error) {
event := "ChangeOfRules"
if log.Topics[0] != dAO.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(DAOChangeOfRules)
Expand Down Expand Up @@ -648,7 +648,7 @@ func (DAOMembershipChanged) ContractEventName() string {
// Solidity: event MembershipChanged(address member, bool isMember)
func (dAO *DAO) UnpackMembershipChangedEvent(log *types.Log) (*DAOMembershipChanged, error) {
event := "MembershipChanged"
if log.Topics[0] != dAO.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(DAOMembershipChanged)
Expand Down Expand Up @@ -692,7 +692,7 @@ func (DAOProposalAdded) ContractEventName() string {
// Solidity: event ProposalAdded(uint256 proposalID, address recipient, uint256 amount, string description)
func (dAO *DAO) UnpackProposalAddedEvent(log *types.Log) (*DAOProposalAdded, error) {
event := "ProposalAdded"
if log.Topics[0] != dAO.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(DAOProposalAdded)
Expand Down Expand Up @@ -736,7 +736,7 @@ func (DAOProposalTallied) ContractEventName() string {
// Solidity: event ProposalTallied(uint256 proposalID, int256 result, uint256 quorum, bool active)
func (dAO *DAO) UnpackProposalTalliedEvent(log *types.Log) (*DAOProposalTallied, error) {
event := "ProposalTallied"
if log.Topics[0] != dAO.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(DAOProposalTallied)
Expand Down Expand Up @@ -780,7 +780,7 @@ func (DAOVoted) ContractEventName() string {
// Solidity: event Voted(uint256 proposalID, bool position, address voter, string justification)
func (dAO *DAO) UnpackVotedEvent(log *types.Log) (*DAOVoted, error) {
event := "Voted"
if log.Topics[0] != dAO.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(DAOVoted)
Expand Down
10 changes: 5 additions & 5 deletions accounts/abi/abigen/testdata/v2/eventchecker.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (EventCheckerDynamic) ContractEventName() string {
// Solidity: event dynamic(string indexed idxStr, bytes indexed idxDat, string str, bytes dat)
func (eventChecker *EventChecker) UnpackDynamicEvent(log *types.Log) (*EventCheckerDynamic, error) {
event := "dynamic"
if log.Topics[0] != eventChecker.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(EventCheckerDynamic)
Expand Down Expand Up @@ -112,7 +112,7 @@ func (EventCheckerEmpty) ContractEventName() string {
// Solidity: event empty()
func (eventChecker *EventChecker) UnpackEmptyEvent(log *types.Log) (*EventCheckerEmpty, error) {
event := "empty"
if log.Topics[0] != eventChecker.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(EventCheckerEmpty)
Expand Down Expand Up @@ -154,7 +154,7 @@ func (EventCheckerIndexed) ContractEventName() string {
// Solidity: event indexed(address indexed addr, int256 indexed num)
func (eventChecker *EventChecker) UnpackIndexedEvent(log *types.Log) (*EventCheckerIndexed, error) {
event := "indexed"
if log.Topics[0] != eventChecker.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(EventCheckerIndexed)
Expand Down Expand Up @@ -196,7 +196,7 @@ func (EventCheckerMixed) ContractEventName() string {
// Solidity: event mixed(address indexed addr, int256 num)
func (eventChecker *EventChecker) UnpackMixedEvent(log *types.Log) (*EventCheckerMixed, error) {
event := "mixed"
if log.Topics[0] != eventChecker.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(EventCheckerMixed)
Expand Down Expand Up @@ -238,7 +238,7 @@ func (EventCheckerUnnamed) ContractEventName() string {
// Solidity: event unnamed(uint256 indexed arg0, uint256 indexed arg1)
func (eventChecker *EventChecker) UnpackUnnamedEvent(log *types.Log) (*EventCheckerUnnamed, error) {
event := "unnamed"
if log.Topics[0] != eventChecker.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(EventCheckerUnnamed)
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abigen/testdata/v2/nameconflict.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (NameConflictLog) ContractEventName() string {
// Solidity: event log(int256 msg, int256 _msg)
func (nameConflict *NameConflict) UnpackLogEvent(log *types.Log) (*NameConflictLog, error) {
event := "log"
if log.Topics[0] != nameConflict.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != nameConflict.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(NameConflictLog)
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abigen/testdata/v2/numericmethodname.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (NumericMethodNameE1TestEvent) ContractEventName() string {
// Solidity: event _1TestEvent(address _param)
func (numericMethodName *NumericMethodName) UnpackE1TestEventEvent(log *types.Log) (*NumericMethodNameE1TestEvent, error) {
event := "_1TestEvent"
if log.Topics[0] != numericMethodName.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != numericMethodName.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(NumericMethodNameE1TestEvent)
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/abigen/testdata/v2/overload.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (OverloadBar) ContractEventName() string {
// Solidity: event bar(uint256 i)
func (overload *Overload) UnpackBarEvent(log *types.Log) (*OverloadBar, error) {
event := "bar"
if log.Topics[0] != overload.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != overload.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(OverloadBar)
Expand Down Expand Up @@ -156,7 +156,7 @@ func (OverloadBar0) ContractEventName() string {
// Solidity: event bar(uint256 i, uint256 j)
func (overload *Overload) UnpackBar0Event(log *types.Log) (*OverloadBar0, error) {
event := "bar0"
if log.Topics[0] != overload.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != overload.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(OverloadBar0)
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abigen/testdata/v2/token.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func (TokenTransfer) ContractEventName() string {
// Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
func (token *Token) UnpackTransferEvent(log *types.Log) (*TokenTransfer, error) {
event := "Transfer"
if log.Topics[0] != token.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != token.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(TokenTransfer)
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/abigen/testdata/v2/tuple.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (TupleTupleEvent) ContractEventName() string {
// Solidity: event TupleEvent((uint256,uint256[],(uint256,uint256)[]) a, (uint256,uint256)[2][] b, (uint256,uint256)[][2] c, (uint256,uint256[],(uint256,uint256)[])[] d, uint256[] e)
func (tuple *Tuple) UnpackTupleEventEvent(log *types.Log) (*TupleTupleEvent, error) {
event := "TupleEvent"
if log.Topics[0] != tuple.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != tuple.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(TupleTupleEvent)
Expand Down Expand Up @@ -234,7 +234,7 @@ func (TupleTupleEvent2) ContractEventName() string {
// Solidity: event TupleEvent2((uint8,uint8)[] arg0)
func (tuple *Tuple) UnpackTupleEvent2Event(log *types.Log) (*TupleTupleEvent2, error) {
event := "TupleEvent2"
if log.Topics[0] != tuple.abi.Events[event].ID {
if len(log.Topics) == 0 || log.Topics[0] != tuple.abi.Events[event].ID {
return nil, errors.New("event signature mismatch")
}
out := new(TupleTupleEvent2)
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/bind/v2/internal/contracts/db/bindings.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions accounts/abi/bind/v2/internal/contracts/events/bindings.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions accounts/abi/bind/v2/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,28 @@ func TestErrors(t *testing.T) {
t.Fatalf("bad unpacked error result: expected Arg4 to be false. got true")
}
}

func TestEventUnpackEmptyTopics(t *testing.T) {
c := events.NewC()

for _, log := range []*types.Log{
{Topics: []common.Hash{}},
{Topics: nil},
} {
_, err := c.UnpackBasic1Event(log)
if err == nil {
t.Fatal("expected error when unpacking event with empty topics, got nil")
}
if err.Error() != "event signature mismatch" {
t.Fatalf("expected 'event signature mismatch' error, got: %v", err)
}

_, err = c.UnpackBasic2Event(log)
if err == nil {
t.Fatal("expected error when unpacking event with empty topics, got nil")
}
if err.Error() != "event signature mismatch" {
t.Fatalf("expected 'event signature mismatch' error, got: %v", err)
}
}
}
24 changes: 12 additions & 12 deletions accounts/abi/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func ConvertType(in interface{}, proto interface{}) interface{} {
// indirect recursively dereferences the value until it either gets the value
// or finds a big.Int
func indirect(v reflect.Value) reflect.Value {
if v.Kind() == reflect.Ptr && v.Elem().Type() != reflect.TypeOf(big.Int{}) {
if v.Kind() == reflect.Ptr && v.Elem().Type() != reflect.TypeFor[big.Int]() {
return indirect(v.Elem())
}
return v
Expand All @@ -65,32 +65,32 @@ func reflectIntType(unsigned bool, size int) reflect.Type {
if unsigned {
switch size {
case 8:
return reflect.TypeOf(uint8(0))
return reflect.TypeFor[uint8]()
case 16:
return reflect.TypeOf(uint16(0))
return reflect.TypeFor[uint16]()
case 32:
return reflect.TypeOf(uint32(0))
return reflect.TypeFor[uint32]()
case 64:
return reflect.TypeOf(uint64(0))
return reflect.TypeFor[uint64]()
}
}
switch size {
case 8:
return reflect.TypeOf(int8(0))
return reflect.TypeFor[int8]()
case 16:
return reflect.TypeOf(int16(0))
return reflect.TypeFor[int16]()
case 32:
return reflect.TypeOf(int32(0))
return reflect.TypeFor[int32]()
case 64:
return reflect.TypeOf(int64(0))
return reflect.TypeFor[int64]()
}
return reflect.TypeOf(&big.Int{})
return reflect.TypeFor[*big.Int]()
}

// mustArrayToByteSlice creates a new byte slice with the exact same size as value
// and copies the bytes in value to the new slice.
func mustArrayToByteSlice(value reflect.Value) reflect.Value {
slice := reflect.MakeSlice(reflect.TypeOf([]byte{}), value.Len(), value.Len())
slice := reflect.ValueOf(make([]byte, value.Len()))
reflect.Copy(slice, value)
return slice
}
Expand All @@ -104,7 +104,7 @@ func set(dst, src reflect.Value) error {
switch {
case dstType.Kind() == reflect.Interface && dst.Elem().IsValid() && (dst.Elem().Type().Kind() == reflect.Ptr || dst.Elem().CanSet()):
return set(dst.Elem(), src)
case dstType.Kind() == reflect.Ptr && dstType.Elem() != reflect.TypeOf(big.Int{}):
case dstType.Kind() == reflect.Ptr && dstType.Elem() != reflect.TypeFor[big.Int]():
return set(dst.Elem(), src)
case srcType.AssignableTo(dstType) && dst.CanSet():
dst.Set(src)
Expand Down
4 changes: 2 additions & 2 deletions accounts/abi/reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ func TestConvertType(t *testing.T) {
var fields []reflect.StructField
fields = append(fields, reflect.StructField{
Name: "X",
Type: reflect.TypeOf(new(big.Int)),
Type: reflect.TypeFor[*big.Int](),
Tag: "json:\"" + "x" + "\"",
})
fields = append(fields, reflect.StructField{
Name: "Y",
Type: reflect.TypeOf(new(big.Int)),
Type: reflect.TypeFor[*big.Int](),
Tag: "json:\"" + "y" + "\"",
})
val := reflect.New(reflect.StructOf(fields))
Expand Down
Loading
Loading