Skip to content

Commit 51614a3

Browse files
authored
Merge pull request #686 from ethereum-optimism/gk/upstream-merge/v1.16.3-rewrite
all: Merge go-ethereum v1.16.3
2 parents 1640202 + 24c89af commit 51614a3

File tree

216 files changed

+8833
-2639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+8833
-2639
lines changed

.github/workflows/validate_pr.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR Format Validation
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize]
6+
7+
jobs:
8+
validate-pr:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check PR Title Format
12+
uses: actions/github-script@v7
13+
with:
14+
script: |
15+
const prTitle = context.payload.pull_request.title;
16+
const titleRegex = /^(\.?[\w\s,{}/]+): .+/;
17+
18+
if (!titleRegex.test(prTitle)) {
19+
core.setFailed(`PR title "${prTitle}" does not match required format: directory, ...: description`);
20+
return;
21+
}
22+
23+
console.log('✅ PR title format is valid');

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ https://pkg.go.dev/badge/github.com/ethereum/go-ethereum
88
[![Go Report Card](https://goreportcard.com/badge/github.com/ethereum/go-ethereum)](https://goreportcard.com/report/github.com/ethereum/go-ethereum)
99
[![Travis](https://app.travis-ci.com/ethereum/go-ethereum.svg?branch=master)](https://app.travis-ci.com/github/ethereum/go-ethereum)
1010
[![Discord](https://img.shields.io/badge/discord-join%20chat-blue.svg)](https://discord.gg/nthXNEv)
11+
[![Twitter](https://img.shields.io/twitter/follow/go_ethereum)](https://x.com/go_ethereum)
1112

1213
Automated builds are available for stable releases and the unstable master branch. Binary
1314
archives are published at https://geth.ethereum.org/downloads/.

accounts/abi/abigen/source2.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ var (
183183
// Solidity: {{.Original.String}}
184184
func ({{ decapitalise $contract.Type}} *{{$contract.Type}}) Unpack{{.Normalized.Name}}Event(log *types.Log) (*{{$contract.Type}}{{.Normalized.Name}}, error) {
185185
event := "{{.Original.Name}}"
186-
if log.Topics[0] != {{ decapitalise $contract.Type}}.abi.Events[event].ID {
186+
if len(log.Topics) == 0 || log.Topics[0] != {{ decapitalise $contract.Type}}.abi.Events[event].ID {
187187
return nil, errors.New("event signature mismatch")
188188
}
189189
out := new({{$contract.Type}}{{.Normalized.Name}})

accounts/abi/abigen/testdata/v2/crowdsale.go.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func (CrowdsaleFundTransfer) ContractEventName() string {
360360
// Solidity: event FundTransfer(address backer, uint256 amount, bool isContribution)
361361
func (crowdsale *Crowdsale) UnpackFundTransferEvent(log *types.Log) (*CrowdsaleFundTransfer, error) {
362362
event := "FundTransfer"
363-
if log.Topics[0] != crowdsale.abi.Events[event].ID {
363+
if len(log.Topics) == 0 || log.Topics[0] != crowdsale.abi.Events[event].ID {
364364
return nil, errors.New("event signature mismatch")
365365
}
366366
out := new(CrowdsaleFundTransfer)

accounts/abi/abigen/testdata/v2/dao.go.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ func (DAOChangeOfRules) ContractEventName() string {
606606
// Solidity: event ChangeOfRules(uint256 minimumQuorum, uint256 debatingPeriodInMinutes, int256 majorityMargin)
607607
func (dAO *DAO) UnpackChangeOfRulesEvent(log *types.Log) (*DAOChangeOfRules, error) {
608608
event := "ChangeOfRules"
609-
if log.Topics[0] != dAO.abi.Events[event].ID {
609+
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
610610
return nil, errors.New("event signature mismatch")
611611
}
612612
out := new(DAOChangeOfRules)
@@ -648,7 +648,7 @@ func (DAOMembershipChanged) ContractEventName() string {
648648
// Solidity: event MembershipChanged(address member, bool isMember)
649649
func (dAO *DAO) UnpackMembershipChangedEvent(log *types.Log) (*DAOMembershipChanged, error) {
650650
event := "MembershipChanged"
651-
if log.Topics[0] != dAO.abi.Events[event].ID {
651+
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
652652
return nil, errors.New("event signature mismatch")
653653
}
654654
out := new(DAOMembershipChanged)
@@ -692,7 +692,7 @@ func (DAOProposalAdded) ContractEventName() string {
692692
// Solidity: event ProposalAdded(uint256 proposalID, address recipient, uint256 amount, string description)
693693
func (dAO *DAO) UnpackProposalAddedEvent(log *types.Log) (*DAOProposalAdded, error) {
694694
event := "ProposalAdded"
695-
if log.Topics[0] != dAO.abi.Events[event].ID {
695+
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
696696
return nil, errors.New("event signature mismatch")
697697
}
698698
out := new(DAOProposalAdded)
@@ -736,7 +736,7 @@ func (DAOProposalTallied) ContractEventName() string {
736736
// Solidity: event ProposalTallied(uint256 proposalID, int256 result, uint256 quorum, bool active)
737737
func (dAO *DAO) UnpackProposalTalliedEvent(log *types.Log) (*DAOProposalTallied, error) {
738738
event := "ProposalTallied"
739-
if log.Topics[0] != dAO.abi.Events[event].ID {
739+
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
740740
return nil, errors.New("event signature mismatch")
741741
}
742742
out := new(DAOProposalTallied)
@@ -780,7 +780,7 @@ func (DAOVoted) ContractEventName() string {
780780
// Solidity: event Voted(uint256 proposalID, bool position, address voter, string justification)
781781
func (dAO *DAO) UnpackVotedEvent(log *types.Log) (*DAOVoted, error) {
782782
event := "Voted"
783-
if log.Topics[0] != dAO.abi.Events[event].ID {
783+
if len(log.Topics) == 0 || log.Topics[0] != dAO.abi.Events[event].ID {
784784
return nil, errors.New("event signature mismatch")
785785
}
786786
out := new(DAOVoted)

accounts/abi/abigen/testdata/v2/eventchecker.go.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (EventCheckerDynamic) ContractEventName() string {
7272
// Solidity: event dynamic(string indexed idxStr, bytes indexed idxDat, string str, bytes dat)
7373
func (eventChecker *EventChecker) UnpackDynamicEvent(log *types.Log) (*EventCheckerDynamic, error) {
7474
event := "dynamic"
75-
if log.Topics[0] != eventChecker.abi.Events[event].ID {
75+
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
7676
return nil, errors.New("event signature mismatch")
7777
}
7878
out := new(EventCheckerDynamic)
@@ -112,7 +112,7 @@ func (EventCheckerEmpty) ContractEventName() string {
112112
// Solidity: event empty()
113113
func (eventChecker *EventChecker) UnpackEmptyEvent(log *types.Log) (*EventCheckerEmpty, error) {
114114
event := "empty"
115-
if log.Topics[0] != eventChecker.abi.Events[event].ID {
115+
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
116116
return nil, errors.New("event signature mismatch")
117117
}
118118
out := new(EventCheckerEmpty)
@@ -154,7 +154,7 @@ func (EventCheckerIndexed) ContractEventName() string {
154154
// Solidity: event indexed(address indexed addr, int256 indexed num)
155155
func (eventChecker *EventChecker) UnpackIndexedEvent(log *types.Log) (*EventCheckerIndexed, error) {
156156
event := "indexed"
157-
if log.Topics[0] != eventChecker.abi.Events[event].ID {
157+
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
158158
return nil, errors.New("event signature mismatch")
159159
}
160160
out := new(EventCheckerIndexed)
@@ -196,7 +196,7 @@ func (EventCheckerMixed) ContractEventName() string {
196196
// Solidity: event mixed(address indexed addr, int256 num)
197197
func (eventChecker *EventChecker) UnpackMixedEvent(log *types.Log) (*EventCheckerMixed, error) {
198198
event := "mixed"
199-
if log.Topics[0] != eventChecker.abi.Events[event].ID {
199+
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
200200
return nil, errors.New("event signature mismatch")
201201
}
202202
out := new(EventCheckerMixed)
@@ -238,7 +238,7 @@ func (EventCheckerUnnamed) ContractEventName() string {
238238
// Solidity: event unnamed(uint256 indexed arg0, uint256 indexed arg1)
239239
func (eventChecker *EventChecker) UnpackUnnamedEvent(log *types.Log) (*EventCheckerUnnamed, error) {
240240
event := "unnamed"
241-
if log.Topics[0] != eventChecker.abi.Events[event].ID {
241+
if len(log.Topics) == 0 || log.Topics[0] != eventChecker.abi.Events[event].ID {
242242
return nil, errors.New("event signature mismatch")
243243
}
244244
out := new(EventCheckerUnnamed)

accounts/abi/abigen/testdata/v2/nameconflict.go.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (NameConflictLog) ContractEventName() string {
134134
// Solidity: event log(int256 msg, int256 _msg)
135135
func (nameConflict *NameConflict) UnpackLogEvent(log *types.Log) (*NameConflictLog, error) {
136136
event := "log"
137-
if log.Topics[0] != nameConflict.abi.Events[event].ID {
137+
if len(log.Topics) == 0 || log.Topics[0] != nameConflict.abi.Events[event].ID {
138138
return nil, errors.New("event signature mismatch")
139139
}
140140
out := new(NameConflictLog)

accounts/abi/abigen/testdata/v2/numericmethodname.go.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (NumericMethodNameE1TestEvent) ContractEventName() string {
136136
// Solidity: event _1TestEvent(address _param)
137137
func (numericMethodName *NumericMethodName) UnpackE1TestEventEvent(log *types.Log) (*NumericMethodNameE1TestEvent, error) {
138138
event := "_1TestEvent"
139-
if log.Topics[0] != numericMethodName.abi.Events[event].ID {
139+
if len(log.Topics) == 0 || log.Topics[0] != numericMethodName.abi.Events[event].ID {
140140
return nil, errors.New("event signature mismatch")
141141
}
142142
out := new(NumericMethodNameE1TestEvent)

accounts/abi/abigen/testdata/v2/overload.go.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (OverloadBar) ContractEventName() string {
114114
// Solidity: event bar(uint256 i)
115115
func (overload *Overload) UnpackBarEvent(log *types.Log) (*OverloadBar, error) {
116116
event := "bar"
117-
if log.Topics[0] != overload.abi.Events[event].ID {
117+
if len(log.Topics) == 0 || log.Topics[0] != overload.abi.Events[event].ID {
118118
return nil, errors.New("event signature mismatch")
119119
}
120120
out := new(OverloadBar)
@@ -156,7 +156,7 @@ func (OverloadBar0) ContractEventName() string {
156156
// Solidity: event bar(uint256 i, uint256 j)
157157
func (overload *Overload) UnpackBar0Event(log *types.Log) (*OverloadBar0, error) {
158158
event := "bar0"
159-
if log.Topics[0] != overload.abi.Events[event].ID {
159+
if len(log.Topics) == 0 || log.Topics[0] != overload.abi.Events[event].ID {
160160
return nil, errors.New("event signature mismatch")
161161
}
162162
out := new(OverloadBar0)

accounts/abi/abigen/testdata/v2/token.go.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ func (TokenTransfer) ContractEventName() string {
386386
// Solidity: event Transfer(address indexed from, address indexed to, uint256 value)
387387
func (token *Token) UnpackTransferEvent(log *types.Log) (*TokenTransfer, error) {
388388
event := "Transfer"
389-
if log.Topics[0] != token.abi.Events[event].ID {
389+
if len(log.Topics) == 0 || log.Topics[0] != token.abi.Events[event].ID {
390390
return nil, errors.New("event signature mismatch")
391391
}
392392
out := new(TokenTransfer)

0 commit comments

Comments
 (0)