Skip to content

Commit 0caee33

Browse files
authored
Merge pull request #1839 from 0xPolygon/mardizzone/upstream-v1.16.4
geth upstream v1.16.4
2 parents d72e55d + eb668c4 commit 0caee33

File tree

757 files changed

+50078
-18654
lines changed

Some content is hidden

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

757 files changed

+50078
-18654
lines changed

.gitea/workflows/release.yml

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
on:
2+
push:
3+
branches:
4+
- "master"
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
linux-intel:
11+
name: Linux Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: 1.24
20+
cache: false
21+
22+
- name: Install cross toolchain
23+
run: |
24+
apt-get update
25+
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
26+
27+
- name: Build (amd64)
28+
run: |
29+
go run build/ci.go install -static -arch amd64 -dlgo
30+
31+
- name: Create/upload archive (amd64)
32+
run: |
33+
go run build/ci.go archive -arch amd64 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
34+
rm -f build/bin/*
35+
env:
36+
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
37+
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
38+
39+
- name: Build (386)
40+
run: |
41+
go run build/ci.go install -static -arch 386 -dlgo
42+
43+
- name: Create/upload archive (386)
44+
run: |
45+
go run build/ci.go archive -arch 386 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
46+
rm -f build/bin/*
47+
env:
48+
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
49+
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
50+
51+
linux-arm:
52+
name: Linux Build (arm)
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Set up Go
58+
uses: actions/setup-go@v5
59+
with:
60+
go-version: 1.24
61+
cache: false
62+
63+
- name: Install cross toolchain
64+
run: |
65+
apt-get update
66+
apt-get -yq --no-install-suggests --no-install-recommends install gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
67+
ln -s /usr/include/asm-generic /usr/include/asm
68+
69+
- name: Build (arm64)
70+
run: |
71+
go run build/ci.go install -static -dlgo -arch arm64 -cc aarch64-linux-gnu-gcc
72+
73+
- name: Create/upload archive (arm64)
74+
run: |
75+
go run build/ci.go archive -arch arm64 -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
76+
rm -fr build/bin/*
77+
env:
78+
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
79+
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
80+
81+
- name: Run build (arm5)
82+
run: |
83+
go run build/ci.go install -static -dlgo -arch arm -cc arm-linux-gnueabi-gcc
84+
env:
85+
GOARM: "5"
86+
87+
- name: Create/upload archive (arm5)
88+
run: |
89+
go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
90+
env:
91+
GOARM: "5"
92+
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
93+
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
94+
95+
- name: Run build (arm6)
96+
run: |
97+
go run build/ci.go install -static -dlgo -arch arm -cc arm-linux-gnueabi-gcc
98+
env:
99+
GOARM: "6"
100+
101+
- name: Create/upload archive (arm6)
102+
run: |
103+
go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
104+
rm -fr build/bin/*
105+
env:
106+
GOARM: "6"
107+
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
108+
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
109+
110+
- name: Run build (arm7)
111+
run: |
112+
go run build/ci.go install -static -dlgo -arch arm -cc arm-linux-gnueabi-gcc
113+
env:
114+
GOARM: "7"
115+
116+
- name: Create/upload archive (arm7)
117+
run: |
118+
go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -upload gethstore/builds
119+
rm -fr build/bin/*
120+
env:
121+
GOARM: "7"
122+
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
123+
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
124+
125+
keeper:
126+
name: Keeper Build
127+
runs-on: ubuntu-latest
128+
steps:
129+
- uses: actions/checkout@v4
130+
131+
- name: Set up Go
132+
uses: actions/setup-go@v5
133+
with:
134+
go-version: 1.24
135+
cache: false
136+
137+
- name: Install cross toolchain
138+
run: |
139+
apt-get update
140+
apt-get -yq --no-install-suggests --no-install-recommends install gcc-multilib
141+
142+
- name: Build (amd64)
143+
run: |
144+
go run build/ci.go keeper -dlgo
145+
146+
windows:
147+
name: Windows Build
148+
runs-on: "win-11"
149+
steps:
150+
- uses: actions/checkout@v4
151+
152+
- name: Set up Go
153+
uses: actions/setup-go@v5
154+
with:
155+
go-version: 1.24
156+
cache: false
157+
158+
# Note: gcc.exe only works properly if the corresponding bin/ directory is
159+
# contained in PATH.
160+
161+
- name: "Build (amd64)"
162+
shell: cmd
163+
run: |
164+
set PATH=%GETH_MINGW%\bin;%PATH%
165+
go run build/ci.go install -dlgo -arch amd64 -cc %GETH_MINGW%\bin\gcc.exe
166+
env:
167+
GETH_MINGW: 'C:\msys64\mingw64'
168+
169+
- name: "Build (386)"
170+
shell: cmd
171+
run: |
172+
set PATH=%GETH_MINGW%\bin;%PATH%
173+
go run build/ci.go install -dlgo -arch 386 -cc %GETH_MINGW%\bin\gcc.exe
174+
env:
175+
GETH_MINGW: 'C:\msys64\mingw32'
176+
177+
docker:
178+
name: Docker Image
179+
runs-on: ubuntu-latest
180+
steps:
181+
- uses: actions/checkout@v4
182+
183+
- name: Set up QEMU
184+
uses: docker/setup-qemu-action@v3
185+
186+
- name: Set up Docker Buildx
187+
uses: docker/setup-buildx-action@v3
188+
189+
- name: Set up Go
190+
uses: actions/setup-go@v5
191+
with:
192+
go-version: 1.24
193+
cache: false
194+
195+
- name: Run docker build
196+
env:
197+
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
198+
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
199+
run: |
200+
go run build/ci.go dockerx -platform linux/amd64,linux/arm64,linux/riscv64 -upload

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ eth/tracers/ @s1na
1919
ethclient/ @fjl
2020
ethdb/ @rjl493456442
2121
event/ @fjl
22-
trie/ @rjl493456442
22+
trie/ @rjl493456442 @gballet
2323
triedb/ @rjl493456442
2424
core/tracing/ @s1na
2525
graphql/ @s1na
@@ -29,5 +29,5 @@ miner/ @MariusVanDerWijden @fjl @rjl493456442
2929
node/ @fjl
3030
p2p/ @fjl @zsfelfoldi
3131
rlp/ @fjl
32-
params/ @fjl @karalabe @gballet @rjl493456442 @zsfelfoldi
32+
params/ @fjl @gballet @rjl493456442 @zsfelfoldi
3333
rpc/ @fjl

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ jobs:
3333
go-version-file: go.mod
3434

3535
- name: Initialize CodeQL
36-
uses: github/codeql-action/init@v2
36+
uses: github/codeql-action/init@v3
3737
with:
3838
languages: ${{ matrix.language }}
3939

4040
- name: Autobuild
41-
uses: github/codeql-action/autobuild@v2
41+
uses: github/codeql-action/autobuild@v3
4242

4343
- name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@v2
44+
uses: github/codeql-action/analyze@v3
4545
with:
4646
category: '/language:${{matrix.language}}'

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ cmd/ethkey/ethkey
6060
cmd/evm/evm
6161
cmd/geth/geth
6262
cmd/rlpdump/rlpdump
63-
cmd/workload/workload
63+
cmd/workload/workload
64+
cmd/keeper/keeper

accounts/abi/abigen/bind.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ import (
3333
"github.com/ethereum/go-ethereum/log"
3434
)
3535

36+
var (
37+
intRegex = regexp.MustCompile(`(u)?int([0-9]*)`)
38+
)
39+
3640
func isKeyWord(arg string) bool {
3741
switch arg {
3842
case "break":
@@ -314,7 +318,7 @@ func bindBasicType(kind abi.Type) string {
314318
case abi.AddressTy:
315319
return "common.Address"
316320
case abi.IntTy, abi.UintTy:
317-
parts := regexp.MustCompile(`(u)?int([0-9]*)`).FindStringSubmatch(kind.String())
321+
parts := intRegex.FindStringSubmatch(kind.String())
318322
switch parts[2] {
319323
case "8", "16", "32", "64":
320324
return fmt.Sprintf("%sint%s", parts[1], parts[2])

accounts/abi/abigen/bind_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,13 +485,13 @@ var bindTests = []struct {
485485
contract Defaulter {
486486
address public caller;
487487
488-
function() {
488+
fallback() external payable {
489489
caller = msg.sender;
490490
}
491491
}
492492
`,
493-
[]string{`6060604052606a8060106000396000f360606040523615601d5760e060020a6000350463fc9c8d3981146040575b605e6000805473ffffffffffffffffffffffffffffffffffffffff191633179055565b606060005473ffffffffffffffffffffffffffffffffffffffff1681565b005b6060908152602090f3`},
494-
[]string{`[{"constant":true,"inputs":[],"name":"caller","outputs":[{"name":"","type":"address"}],"type":"function"}]`},
493+
[]string{`608060405234801561000f575f80fd5b5061013d8061001d5f395ff3fe608060405260043610610021575f3560e01c8063fc9c8d391461006257610022565b5b335f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055005b34801561006d575f80fd5b5061007661008c565b60405161008391906100ee565b60405180910390f35b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100d8826100af565b9050919050565b6100e8816100ce565b82525050565b5f6020820190506101015f8301846100df565b9291505056fea26469706673582212201e9273ecfb1f534644c77f09a25c21baaba81cf1c444ebc071e12a225a23c72964736f6c63430008140033`},
494+
[]string{`[{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"caller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]`},
495495
`
496496
"math/big"
497497

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)

0 commit comments

Comments
 (0)