Skip to content

Commit a9523b6

Browse files
committed
Merge branch 'master' into release/1.14
2 parents aa55f5e + 880511d commit a9523b6

File tree

125 files changed

+1055
-7834
lines changed

Some content is hidden

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

125 files changed

+1055
-7834
lines changed

.github/CODEOWNERS

-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,4 @@ light/ @zsfelfoldi @rjl493456442
2121
node/ @fjl
2222
p2p/ @fjl @zsfelfoldi
2323
rpc/ @fjl @holiman
24-
p2p/simulations @fjl
25-
p2p/protocols @fjl
26-
p2p/testing @fjl
2724
signer/ @holiman

.golangci.yml

-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ issues:
6464
text: 'SA1019: "golang.org/x/crypto/openpgp" is deprecated: this package is unmaintained except for security fixes.'
6565
- path: core/vm/contracts.go
6666
text: 'SA1019: "golang.org/x/crypto/ripemd160" is deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications.'
67-
- path: accounts/usbwallet/trezor.go
68-
text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.'
69-
- path: accounts/usbwallet/trezor/
70-
text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.'
7167
exclude:
7268
- 'SA1019: event.TypeMux is deprecated: use Feed'
7369
- 'SA1019: strings.Title is deprecated'

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ clean:
4242
devtools:
4343
env GOBIN= go install golang.org/x/tools/cmd/stringer@latest
4444
env GOBIN= go install github.com/fjl/gencodec@latest
45-
env GOBIN= go install github.com/golang/protobuf/protoc-gen-go@latest
45+
env GOBIN= go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
4646
env GOBIN= go install ./cmd/abigen
4747
@type "solc" 2> /dev/null || echo 'Please install solc'
4848
@type "protoc" 2> /dev/null || echo 'Please install protoc'

SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,5 +171,5 @@ i4O1UeWKs9owWttan9+PI47ozBSKOTxmMqLSQ0f56Np9FJsV0ilGxRKfjhzJ4KniOMUBA7mP
171171
epy6lH7HmxjjOR7eo0DaSxQGQpThAtFGwkWkFh8yki8j3E42kkrxvEyyYZDXn2YcI3bpqhJx
172172
PtwCMZUJ3kc/skOrs6bOI19iBNaEoNX5Dllm7UHjOgWNDQkcCuOCxucKano=
173173
=arte
174-
-----END PGP PUBLIC KEY BLOCK------
174+
-----END PGP PUBLIC KEY BLOCK-----
175175
```

accounts/abi/bind/base.go

+16-14
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ type TransactOpts struct {
5959
Nonce *big.Int // Nonce to use for the transaction execution (nil = use pending state)
6060
Signer SignerFn // Method to use for signing the transaction (mandatory)
6161

62-
Value *big.Int // Funds to transfer along the transaction (nil = 0 = no funds)
63-
GasPrice *big.Int // Gas price to use for the transaction execution (nil = gas price oracle)
64-
GasFeeCap *big.Int // Gas fee cap to use for the 1559 transaction execution (nil = gas price oracle)
65-
GasTipCap *big.Int // Gas priority fee cap to use for the 1559 transaction execution (nil = gas price oracle)
66-
GasLimit uint64 // Gas limit to set for the transaction execution (0 = estimate)
62+
Value *big.Int // Funds to transfer along the transaction (nil = 0 = no funds)
63+
GasPrice *big.Int // Gas price to use for the transaction execution (nil = gas price oracle)
64+
GasFeeCap *big.Int // Gas fee cap to use for the 1559 transaction execution (nil = gas price oracle)
65+
GasTipCap *big.Int // Gas priority fee cap to use for the 1559 transaction execution (nil = gas price oracle)
66+
GasLimit uint64 // Gas limit to set for the transaction execution (0 = estimate)
67+
AccessList types.AccessList // Access list to set for the transaction execution (nil = no access list)
6768

6869
Context context.Context // Network context to support cancellation and timeouts (nil = no timeout)
6970

@@ -300,20 +301,21 @@ func (c *BoundContract) createDynamicTx(opts *TransactOpts, contract *common.Add
300301
return nil, err
301302
}
302303
baseTx := &types.DynamicFeeTx{
303-
To: contract,
304-
Nonce: nonce,
305-
GasFeeCap: gasFeeCap,
306-
GasTipCap: gasTipCap,
307-
Gas: gasLimit,
308-
Value: value,
309-
Data: input,
304+
To: contract,
305+
Nonce: nonce,
306+
GasFeeCap: gasFeeCap,
307+
GasTipCap: gasTipCap,
308+
Gas: gasLimit,
309+
Value: value,
310+
Data: input,
311+
AccessList: opts.AccessList,
310312
}
311313
return types.NewTx(baseTx), nil
312314
}
313315

314316
func (c *BoundContract) createLegacyTx(opts *TransactOpts, contract *common.Address, input []byte) (*types.Transaction, error) {
315-
if opts.GasFeeCap != nil || opts.GasTipCap != nil {
316-
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet")
317+
if opts.GasFeeCap != nil || opts.GasTipCap != nil || opts.AccessList != nil {
318+
return nil, errors.New("maxFeePerGas or maxPriorityFeePerGas or accessList specified but london is not active yet")
317319
}
318320
// Normalize value
319321
value := opts.Value

accounts/keystore/account_cache_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func TestWatchNewFile(t *testing.T) {
114114
func TestWatchNoDir(t *testing.T) {
115115
t.Parallel()
116116
// Create ks but not the directory that it watches.
117-
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-watchnodir-test-%d-%d", os.Getpid(), rand.Int()))
117+
dir := filepath.Join(t.TempDir(), fmt.Sprintf("eth-keystore-watchnodir-test-%d-%d", os.Getpid(), rand.Int()))
118118
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
119119
list := ks.Accounts()
120120
if len(list) > 0 {
@@ -126,7 +126,6 @@ func TestWatchNoDir(t *testing.T) {
126126
}
127127
// Create the directory and copy a key file into it.
128128
os.MkdirAll(dir, 0700)
129-
defer os.RemoveAll(dir)
130129
file := filepath.Join(dir, "aaa")
131130
if err := cp.CopyFile(file, cachetestAccounts[0].URL.Path); err != nil {
132131
t.Fatal(err)

accounts/usbwallet/trezor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"github.com/ethereum/go-ethereum/common/hexutil"
3434
"github.com/ethereum/go-ethereum/core/types"
3535
"github.com/ethereum/go-ethereum/log"
36-
"github.com/golang/protobuf/proto"
36+
"google.golang.org/protobuf/proto"
3737
)
3838

3939
// ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In

accounts/usbwallet/trezor/trezor.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
// - Download the latest protoc https://github.com/protocolbuffers/protobuf/releases
4040
// - Build with the usual `./configure && make` and ensure it's on your $PATH
4141
// - Delete all the .proto and .pb.go files, pull in fresh ones from Trezor
42-
// - Grab the latest Go plugin `go get -u github.com/golang/protobuf/protoc-gen-go`
43-
// - Vendor in the latest Go plugin `govendor fetch github.com/golang/protobuf/...`
42+
// - Grab the latest Go plugin `go get -u google.golang.org/protobuf/cmd/protoc-gen-go`
43+
// - Vendor in the latest Go plugin `govendor fetch google.golang.org/protobuf/...`
4444

4545
//go:generate protoc -I/usr/local/include:. --go_out=paths=source_relative:. messages.proto messages-common.proto messages-management.proto messages-ethereum.proto
4646

@@ -50,7 +50,7 @@ package trezor
5050
import (
5151
"reflect"
5252

53-
"github.com/golang/protobuf/proto"
53+
"google.golang.org/protobuf/proto"
5454
)
5555

5656
// Type returns the protocol buffer type number of a specific message. If the

beacon/engine/types.go

+29-28
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/ethereum/go-ethereum/common"
2525
"github.com/ethereum/go-ethereum/common/hexutil"
2626
"github.com/ethereum/go-ethereum/core/types"
27+
"github.com/ethereum/go-ethereum/params"
2728
"github.com/ethereum/go-ethereum/trie"
2829
)
2930

@@ -193,21 +194,21 @@ func decodeTransactions(enc [][]byte) ([]*types.Transaction, error) {
193194
//
194195
// and that the blockhash of the constructed block matches the parameters. Nil
195196
// Withdrawals value will propagate through the returned block. Empty
196-
// Withdrawals value must be passed via non-nil, length 0 value in params.
197-
func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash, beaconRoot *common.Hash) (*types.Block, error) {
198-
txs, err := decodeTransactions(params.Transactions)
197+
// Withdrawals value must be passed via non-nil, length 0 value in data.
198+
func ExecutableDataToBlock(data ExecutableData, versionedHashes []common.Hash, beaconRoot *common.Hash) (*types.Block, error) {
199+
txs, err := decodeTransactions(data.Transactions)
199200
if err != nil {
200201
return nil, err
201202
}
202-
if len(params.ExtraData) > 32 {
203-
return nil, fmt.Errorf("invalid extradata length: %v", len(params.ExtraData))
203+
if len(data.ExtraData) > int(params.MaximumExtraDataSize) {
204+
return nil, fmt.Errorf("invalid extradata length: %v", len(data.ExtraData))
204205
}
205-
if len(params.LogsBloom) != 256 {
206-
return nil, fmt.Errorf("invalid logsBloom length: %v", len(params.LogsBloom))
206+
if len(data.LogsBloom) != 256 {
207+
return nil, fmt.Errorf("invalid logsBloom length: %v", len(data.LogsBloom))
207208
}
208209
// Check that baseFeePerGas is not negative or too big
209-
if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) {
210-
return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas)
210+
if data.BaseFeePerGas != nil && (data.BaseFeePerGas.Sign() == -1 || data.BaseFeePerGas.BitLen() > 256) {
211+
return nil, fmt.Errorf("invalid baseFeePerGas: %v", data.BaseFeePerGas)
211212
}
212213
var blobHashes = make([]common.Hash, 0, len(txs))
213214
for _, tx := range txs {
@@ -225,34 +226,34 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash,
225226
// ExecutableData before withdrawals are enabled by marshaling
226227
// Withdrawals as the json null value.
227228
var withdrawalsRoot *common.Hash
228-
if params.Withdrawals != nil {
229-
h := types.DeriveSha(types.Withdrawals(params.Withdrawals), trie.NewStackTrie(nil))
229+
if data.Withdrawals != nil {
230+
h := types.DeriveSha(types.Withdrawals(data.Withdrawals), trie.NewStackTrie(nil))
230231
withdrawalsRoot = &h
231232
}
232233
header := &types.Header{
233-
ParentHash: params.ParentHash,
234+
ParentHash: data.ParentHash,
234235
UncleHash: types.EmptyUncleHash,
235-
Coinbase: params.FeeRecipient,
236-
Root: params.StateRoot,
236+
Coinbase: data.FeeRecipient,
237+
Root: data.StateRoot,
237238
TxHash: types.DeriveSha(types.Transactions(txs), trie.NewStackTrie(nil)),
238-
ReceiptHash: params.ReceiptsRoot,
239-
Bloom: types.BytesToBloom(params.LogsBloom),
239+
ReceiptHash: data.ReceiptsRoot,
240+
Bloom: types.BytesToBloom(data.LogsBloom),
240241
Difficulty: common.Big0,
241-
Number: new(big.Int).SetUint64(params.Number),
242-
GasLimit: params.GasLimit,
243-
GasUsed: params.GasUsed,
244-
Time: params.Timestamp,
245-
BaseFee: params.BaseFeePerGas,
246-
Extra: params.ExtraData,
247-
MixDigest: params.Random,
242+
Number: new(big.Int).SetUint64(data.Number),
243+
GasLimit: data.GasLimit,
244+
GasUsed: data.GasUsed,
245+
Time: data.Timestamp,
246+
BaseFee: data.BaseFeePerGas,
247+
Extra: data.ExtraData,
248+
MixDigest: data.Random,
248249
WithdrawalsHash: withdrawalsRoot,
249-
ExcessBlobGas: params.ExcessBlobGas,
250-
BlobGasUsed: params.BlobGasUsed,
250+
ExcessBlobGas: data.ExcessBlobGas,
251+
BlobGasUsed: data.BlobGasUsed,
251252
ParentBeaconRoot: beaconRoot,
252253
}
253-
block := types.NewBlockWithHeader(header).WithBody(types.Body{Transactions: txs, Uncles: nil, Withdrawals: params.Withdrawals})
254-
if block.Hash() != params.BlockHash {
255-
return nil, fmt.Errorf("blockhash mismatch, want %x, got %x", params.BlockHash, block.Hash())
254+
block := types.NewBlockWithHeader(header).WithBody(types.Body{Transactions: txs, Uncles: nil, Withdrawals: data.Withdrawals})
255+
if block.Hash() != data.BlockHash {
256+
return nil, fmt.Errorf("blockhash mismatch, want %x, got %x", data.BlockHash, block.Hash())
256257
}
257258
return block, nil
258259
}

beacon/types/beacon_block.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func BlockFromJSON(forkName string, data []byte) (*BeaconBlock, error) {
4848
case "capella":
4949
obj = new(capella.BeaconBlock)
5050
default:
51-
return nil, fmt.Errorf("unsupported fork: " + forkName)
51+
return nil, fmt.Errorf("unsupported fork: %s", forkName)
5252
}
5353
if err := json.Unmarshal(data, obj); err != nil {
5454
return nil, err

beacon/types/exec_header.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func ExecutionHeaderFromJSON(forkName string, data []byte) (*ExecutionHeader, er
4646
case "deneb":
4747
obj = new(deneb.ExecutionPayloadHeader)
4848
default:
49-
return nil, fmt.Errorf("unsupported fork: " + forkName)
49+
return nil, fmt.Errorf("unsupported fork: %s", forkName)
5050
}
5151
if err := json.Unmarshal(data, obj); err != nil {
5252
return nil, err

0 commit comments

Comments
 (0)