Skip to content

Commit e22a150

Browse files
authored
Merge pull request ethereum#28 from onflow/mpeter/sync-with-geth-v1.16.2
Sync with Geth `v1.16.2`
2 parents c5c5c04 + d9026a7 commit e22a150

File tree

187 files changed

+9139
-994
lines changed

Some content is hidden

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

187 files changed

+9139
-994
lines changed

.gitea/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
- "master"
55
tags:
66
- "v*"
7+
workflow_dispatch:
78

89
jobs:
910
linux-intel:
@@ -121,6 +122,37 @@ jobs:
121122
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
122123
AZURE_BLOBSTORE_TOKEN: ${{ secrets.AZURE_BLOBSTORE_TOKEN }}
123124

125+
windows:
126+
name: Windows Build
127+
runs-on: "win-11"
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+
# Note: gcc.exe only works properly if the corresponding bin/ directory is
138+
# contained in PATH.
139+
140+
- name: "Build (amd64)"
141+
shell: cmd
142+
run: |
143+
set PATH=%GETH_MINGW%\bin;%PATH%
144+
go run build/ci.go install -dlgo -arch amd64 -cc %GETH_MINGW%\bin\gcc.exe
145+
env:
146+
GETH_MINGW: 'C:\msys64\mingw64'
147+
148+
- name: "Build (386)"
149+
shell: cmd
150+
run: |
151+
set PATH=%GETH_MINGW%\bin;%PATH%
152+
go run build/ci.go install -dlgo -arch 386 -cc %GETH_MINGW%\bin\gcc.exe
153+
env:
154+
GETH_MINGW: 'C:\msys64\mingw32'
155+
124156
docker:
125157
name: Docker Image
126158
runs-on: ubuntu-latest

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/go.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
name: i386 linux tests
2-
31
on:
42
push:
5-
branches: [ master ]
3+
branches:
4+
- master
65
pull_request:
7-
branches: [ master ]
6+
branches:
7+
- master
88
workflow_dispatch:
99

1010
jobs:
1111
lint:
1212
name: Lint
13-
runs-on: self-hosted
13+
runs-on: self-hosted-ghr
1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
submodules: false
1618

1719
# Cache build tools to avoid downloading them each time
1820
- uses: actions/cache@v4
@@ -23,7 +25,7 @@ jobs:
2325
- name: Set up Go
2426
uses: actions/setup-go@v5
2527
with:
26-
go-version: 1.23.0
28+
go-version: 1.24
2729
cache: false
2830

2931
- name: Run linters
@@ -32,17 +34,25 @@ jobs:
3234
go run build/ci.go check_generate
3335
go run build/ci.go check_baddeps
3436
35-
build:
36-
runs-on: self-hosted
37+
test:
38+
name: Test
39+
needs: lint
40+
runs-on: self-hosted-ghr
41+
strategy:
42+
matrix:
43+
go:
44+
- '1.24'
45+
- '1.23'
3746
steps:
3847
- uses: actions/checkout@v4
48+
with:
49+
submodules: true
50+
3951
- name: Set up Go
4052
uses: actions/setup-go@v5
4153
with:
42-
go-version: 1.24.0
54+
go-version: ${{ matrix.go }}
4355
cache: false
56+
4457
- name: Run tests
45-
run: go test -short ./...
46-
env:
47-
GOOS: linux
48-
GOARCH: 386
58+
run: go test ./...

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/onflow/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":
@@ -299,7 +303,7 @@ func bindBasicType(kind abi.Type) string {
299303
case abi.AddressTy:
300304
return "common.Address"
301305
case abi.IntTy, abi.UintTy:
302-
parts := regexp.MustCompile(`(u)?int([0-9]*)`).FindStringSubmatch(kind.String())
306+
parts := intRegex.FindStringSubmatch(kind.String())
303307
switch parts[2] {
304308
case "8", "16", "32", "64":
305309
return fmt.Sprintf("%sint%s", parts[1], parts[2])

accounts/abi/bind/v2/lib.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ package bind
2828

2929
import (
3030
"errors"
31+
"math/big"
3132

3233
"github.com/onflow/go-ethereum"
3334
"github.com/onflow/go-ethereum/accounts/abi"
@@ -241,3 +242,27 @@ func DefaultDeployer(opts *TransactOpts, backend ContractBackend) DeployFn {
241242
return addr, tx, nil
242243
}
243244
}
245+
246+
// DeployerWithNonceAssignment is basically identical to DefaultDeployer,
247+
// but it additionally tracks the nonce to enable automatic assignment.
248+
//
249+
// This is especially useful when deploying multiple contracts
250+
// from the same address — whether they are independent contracts
251+
// or part of a dependency chain that must be deployed in order.
252+
func DeployerWithNonceAssignment(opts *TransactOpts, backend ContractBackend) DeployFn {
253+
var pendingNonce int64
254+
if opts.Nonce != nil {
255+
pendingNonce = opts.Nonce.Int64()
256+
}
257+
return func(input []byte, deployer []byte) (common.Address, *types.Transaction, error) {
258+
if pendingNonce != 0 {
259+
opts.Nonce = big.NewInt(pendingNonce)
260+
}
261+
addr, tx, err := DeployContract(opts, deployer, backend, input)
262+
if err != nil {
263+
return common.Address{}, nil, err
264+
}
265+
pendingNonce = int64(tx.Nonce() + 1)
266+
return addr, tx, nil
267+
}
268+
}

accounts/abi/bind/v2/lib_test.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ func makeTestDeployer(backend simulated.Client) func(input, deployer []byte) (co
6565
return bind.DefaultDeployer(bind.NewKeyedTransactor(testKey, chainId), backend)
6666
}
6767

68+
// makeTestDeployerWithNonceAssignment is similar to makeTestDeployer,
69+
// but it returns a deployer that automatically tracks nonce,
70+
// enabling the deployment of multiple contracts from the same account.
71+
func makeTestDeployerWithNonceAssignment(backend simulated.Client) func(input, deployer []byte) (common.Address, *types.Transaction, error) {
72+
chainId, _ := backend.ChainID(context.Background())
73+
return bind.DeployerWithNonceAssignment(bind.NewKeyedTransactor(testKey, chainId), backend)
74+
}
75+
6876
// test that deploying a contract with library dependencies works,
6977
// verifying by calling method on the deployed contract.
7078
func TestDeploymentLibraries(t *testing.T) {
@@ -80,7 +88,7 @@ func TestDeploymentLibraries(t *testing.T) {
8088
Contracts: []*bind.MetaData{&nested_libraries.C1MetaData},
8189
Inputs: map[string][]byte{nested_libraries.C1MetaData.ID: constructorInput},
8290
}
83-
res, err := bind.LinkAndDeploy(deploymentParams, makeTestDeployer(bindBackend.Client))
91+
res, err := bind.LinkAndDeploy(deploymentParams, makeTestDeployerWithNonceAssignment(bindBackend.Client))
8492
if err != nil {
8593
t.Fatalf("err: %+v\n", err)
8694
}
@@ -122,7 +130,7 @@ func TestDeploymentWithOverrides(t *testing.T) {
122130
deploymentParams := &bind.DeploymentParams{
123131
Contracts: nested_libraries.C1MetaData.Deps,
124132
}
125-
res, err := bind.LinkAndDeploy(deploymentParams, makeTestDeployer(bindBackend))
133+
res, err := bind.LinkAndDeploy(deploymentParams, makeTestDeployerWithNonceAssignment(bindBackend))
126134
if err != nil {
127135
t.Fatalf("err: %+v\n", err)
128136
}

accounts/keystore/keystore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// Package keystore implements encrypted storage of secp256k1 private keys.
1818
//
1919
// Keys are stored as encrypted JSON files according to the Web3 Secret Storage specification.
20-
// See https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition for more information.
20+
// See https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/ for more information.
2121
package keystore
2222

2323
import (

accounts/keystore/passphrase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
This key store behaves as KeyStorePlain with the difference that
2020
the private key is encrypted and on disk uses another JSON encoding.
2121
22-
The crypto is documented at https://github.com/ethereum/wiki/wiki/Web3-Secret-Storage-Definition
22+
The crypto is documented at https://ethereum.org/en/developers/docs/data-structures-and-encoding/web3-secret-storage/
2323
2424
*/
2525

beacon/engine/types_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,13 @@ func TestBlobs(t *testing.T) {
3434
header := types.Header{}
3535
block := types.NewBlock(&header, &types.Body{}, nil, nil)
3636

37-
sidecarWithoutCellProofs := &types.BlobTxSidecar{
38-
Blobs: []kzg4844.Blob{*emptyBlob},
39-
Commitments: []kzg4844.Commitment{emptyBlobCommit},
40-
Proofs: []kzg4844.Proof{emptyBlobProof},
41-
}
37+
sidecarWithoutCellProofs := types.NewBlobTxSidecar(types.BlobSidecarVersion0, []kzg4844.Blob{*emptyBlob}, []kzg4844.Commitment{emptyBlobCommit}, []kzg4844.Proof{emptyBlobProof})
4238
env := BlockToExecutableData(block, common.Big0, []*types.BlobTxSidecar{sidecarWithoutCellProofs}, nil)
4339
if len(env.BlobsBundle.Proofs) != 1 {
4440
t.Fatalf("Expect 1 proof in blobs bundle, got %v", len(env.BlobsBundle.Proofs))
4541
}
4642

47-
sidecarWithCellProofs := &types.BlobTxSidecar{
48-
Blobs: []kzg4844.Blob{*emptyBlob},
49-
Commitments: []kzg4844.Commitment{emptyBlobCommit},
50-
Proofs: emptyCellProof,
51-
}
43+
sidecarWithCellProofs := types.NewBlobTxSidecar(types.BlobSidecarVersion0, []kzg4844.Blob{*emptyBlob}, []kzg4844.Commitment{emptyBlobCommit}, emptyCellProof)
5244
env = BlockToExecutableData(block, common.Big0, []*types.BlobTxSidecar{sidecarWithCellProofs}, nil)
5345
if len(env.BlobsBundle.Proofs) != 128 {
5446
t.Fatalf("Expect 128 proofs in blobs bundle, got %v", len(env.BlobsBundle.Proofs))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0xd60e5310c5d52ced44cfb13be4e9f22a1e6a6dc56964c3cccd429182d26d72d0
1+
0x4bae4b97deda095724560012cab1f80a5221ce0a37a4b5236d8ab63f595f29d9

0 commit comments

Comments
 (0)