Skip to content

Commit 39a2d17

Browse files
Merge pull request #311 from OffchainLabs/merge-v1.13.11
Merge v1.13.11
2 parents 41e40f1 + cc9e427 commit 39a2d17

File tree

168 files changed

+2479
-1637
lines changed

Some content is hidden

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

168 files changed

+2479
-1637
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
go-version: 1.21.4
1919
- name: Run tests
20-
run: go test ./...
20+
run: go test -short ./...
2121
env:
2222
GOOS: linux
2323
GOARCH: 386

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Go Ethereum
22

3-
Official Golang execution layer implementation of the Ethereum protocol.
3+
Golang execution layer implementation of the Ethereum protocol.
44

55
[![API Reference](
6-
https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667
6+
https://pkg.go.dev/badge/github.com/ethereum/go-ethereum
77
)](https://pkg.go.dev/github.com/ethereum/go-ethereum?tab=doc)
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://travis-ci.com/ethereum/go-ethereum.svg?branch=master)](https://travis-ci.com/ethereum/go-ethereum)

accounts/abi/bind/backends/simulated.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (b *SimulatedBackend) Fork(ctx context.Context, parentHash common.Hash) err
4444
// Deprecated: please use simulated.Backend from package
4545
// github.com/ethereum/go-ethereum/ethclient/simulated instead.
4646
func NewSimulatedBackend(alloc core.GenesisAlloc, gasLimit uint64) *SimulatedBackend {
47-
b := simulated.New(alloc, gasLimit)
47+
b := simulated.NewBackend(alloc, simulated.WithBlockGasLimit(gasLimit))
4848
return &SimulatedBackend{
4949
Backend: b,
5050
Client: b.Client(),

accounts/abi/bind/util_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ var waitDeployedTests = map[string]struct {
5656
func TestWaitDeployed(t *testing.T) {
5757
t.Parallel()
5858
for name, test := range waitDeployedTests {
59-
backend := simulated.New(
59+
backend := simulated.NewBackend(
6060
core.GenesisAlloc{
6161
crypto.PubkeyToAddress(testKey.PublicKey): {Balance: big.NewInt(10000000000000000)},
6262
},
63-
10000000,
6463
)
6564
defer backend.Close()
6665

@@ -102,11 +101,10 @@ func TestWaitDeployed(t *testing.T) {
102101
}
103102

104103
func TestWaitDeployedCornerCases(t *testing.T) {
105-
backend := simulated.New(
104+
backend := simulated.NewBackend(
106105
core.GenesisAlloc{
107106
crypto.PubkeyToAddress(testKey.PublicKey): {Balance: big.NewInt(10000000000000000)},
108107
},
109-
10000000,
110108
)
111109
defer backend.Close()
112110

accounts/usbwallet/ledger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ func (w *ledgerDriver) ledgerDerive(derivationPath []uint32) (common.Address, er
279279
}
280280
hexstr := reply[1 : 1+int(reply[0])]
281281

282-
// Decode the hex sting into an Ethereum address and return
282+
// Decode the hex string into an Ethereum address and return
283283
var address common.Address
284284
if _, err = hex.Decode(address[:], hexstr); err != nil {
285285
return common.Address{}, err

arbitrum/apibackend.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,9 @@ func (a *APIBackend) SendConditionalTx(ctx context.Context, signedTx *types.Tran
603603
return a.b.EnqueueL2Message(ctx, signedTx, options)
604604
}
605605

606-
func (a *APIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (*types.Transaction, common.Hash, uint64, uint64, error) {
606+
func (a *APIBackend) GetTransaction(ctx context.Context, txHash common.Hash) (bool, *types.Transaction, common.Hash, uint64, uint64, error) {
607607
tx, blockHash, blockNumber, index := rawdb.ReadTransaction(a.b.chainDb, txHash)
608-
return tx, blockHash, blockNumber, index, nil
608+
return true, tx, blockHash, blockNumber, index, nil
609609
}
610610

611611
func (a *APIBackend) GetPoolTransactions() (types.Transactions, error) {

beacon/engine/types.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ import (
2626
"github.com/ethereum/go-ethereum/trie"
2727
)
2828

29+
// PayloadVersion denotes the version of PayloadAttributes used to request the
30+
// building of the payload to commence.
31+
type PayloadVersion byte
32+
33+
var (
34+
PayloadV1 PayloadVersion = 0x1
35+
PayloadV2 PayloadVersion = 0x2
36+
PayloadV3 PayloadVersion = 0x3
37+
)
38+
2939
//go:generate go run github.com/fjl/gencodec -type PayloadAttributes -field-override payloadAttributesMarshaling -out gen_blockparams.go
3040

3141
// PayloadAttributes describes the environment context in which a block should
@@ -115,6 +125,21 @@ type TransitionConfigurationV1 struct {
115125
// PayloadID is an identifier of the payload build process
116126
type PayloadID [8]byte
117127

128+
// Version returns the payload version associated with the identifier.
129+
func (b PayloadID) Version() PayloadVersion {
130+
return PayloadVersion(b[0])
131+
}
132+
133+
// Is returns whether the identifier matches any of provided payload versions.
134+
func (b PayloadID) Is(versions ...PayloadVersion) bool {
135+
for _, v := range versions {
136+
if v == b.Version() {
137+
return true
138+
}
139+
}
140+
return false
141+
}
142+
118143
func (b PayloadID) String() string {
119144
return hexutil.Encode(b[:])
120145
}

build/checksums.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
# https://github.com/ethereum/execution-spec-tests/releases/download/v1.0.6/
66
485af7b66cf41eb3a8c1bd46632913b8eb95995df867cf665617bbc9b4beedd1 fixtures_develop.tar.gz
77

8-
# version:golang 1.21.5
8+
# version:golang 1.21.6
99
# https://go.dev/dl/
10-
285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19 go1.21.5.src.tar.gz
11-
a2e1d5743e896e5fe1e7d96479c0a769254aed18cf216cf8f4c3a2300a9b3923 go1.21.5.darwin-amd64.tar.gz
12-
d0f8ac0c4fb3efc223a833010901d02954e3923cfe2c9a2ff0e4254a777cc9cc go1.21.5.darwin-arm64.tar.gz
13-
2c05bbe0dc62456b90b7ddd354a54f373b7c377a98f8b22f52ab694b4f6cca58 go1.21.5.freebsd-386.tar.gz
14-
30b6c64e9a77129605bc12f836422bf09eec577a8c899ee46130aeff81567003 go1.21.5.freebsd-amd64.tar.gz
15-
8f4dba9cf5c61757bbd7e9ebdb93b6a30a1b03f4a636a1ba0cc2f27b907ab8e1 go1.21.5.linux-386.tar.gz
16-
e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e go1.21.5.linux-amd64.tar.gz
17-
841cced7ecda9b2014f139f5bab5ae31785f35399f236b8b3e75dff2a2978d96 go1.21.5.linux-arm64.tar.gz
18-
837f4bf4e22fcdf920ffeaa4abf3d02d1314e03725431065f4d44c46a01b42fe go1.21.5.linux-armv6l.tar.gz
19-
907b8c6ec4be9b184952e5d3493be66b1746442394a8bc78556c56834cd7c38b go1.21.5.linux-ppc64le.tar.gz
20-
9c4a81b72ebe44368813cd03684e1080a818bf915d84163abae2ed325a1b2dc0 go1.21.5.linux-s390x.tar.gz
21-
6da2418889dfb37763d0eb149c4a8d728c029e12f0cd54fbca0a31ae547e2d34 go1.21.5.windows-386.zip
22-
bbe603cde7c9dee658f45164b4d06de1eff6e6e6b800100824e7c00d56a9a92f go1.21.5.windows-amd64.zip
23-
9b7acca50e674294e43202df4fbc26d5af4d8bc3170a3342a1514f09a2dab5e9 go1.21.5.windows-arm64.zip
10+
124926a62e45f78daabbaedb9c011d97633186a33c238ffc1e25320c02046248 go1.21.6.src.tar.gz
11+
31d6ecca09010ab351e51343a5af81d678902061fee871f912bdd5ef4d778850 go1.21.6.darwin-amd64.tar.gz
12+
0ff541fb37c38e5e5c5bcecc8f4f43c5ffd5e3a6c33a5d3e4003ded66fcfb331 go1.21.6.darwin-arm64.tar.gz
13+
a1d1a149b34bf0f53965a237682c6da1140acabb131bf0e597240e4a140b0e5e go1.21.6.freebsd-386.tar.gz
14+
de59e1217e4398b1522eed8dddabab2fa1b97aecbdca3af08e34832b4f0e3f81 go1.21.6.freebsd-amd64.tar.gz
15+
05d09041b5a1193c14e4b2db3f7fcc649b236c567f5eb93305c537851b72dd95 go1.21.6.linux-386.tar.gz
16+
3f934f40ac360b9c01f616a9aa1796d227d8b0328bf64cb045c7b8c4ee9caea4 go1.21.6.linux-amd64.tar.gz
17+
e2e8aa88e1b5170a0d495d7d9c766af2b2b6c6925a8f8956d834ad6b4cacbd9a go1.21.6.linux-arm64.tar.gz
18+
6a8eda6cc6a799ff25e74ce0c13fdc1a76c0983a0bb07c789a2a3454bf6ec9b2 go1.21.6.linux-armv6l.tar.gz
19+
e872b1e9a3f2f08fd4554615a32ca9123a4ba877ab6d19d36abc3424f86bc07f go1.21.6.linux-ppc64le.tar.gz
20+
92894d0f732d3379bc414ffdd617eaadad47e1d72610e10d69a1156db03fc052 go1.21.6.linux-s390x.tar.gz
21+
65b38857135cf45c80e1d267e0ce4f80fe149326c68835217da4f2da9b7943fe go1.21.6.windows-386.zip
22+
27ac9dd6e66fb3fd0acfa6792ff053c86e7d2c055b022f4b5d53bfddec9e3301 go1.21.6.windows-amd64.zip
23+
b93aff8f3c882c764c66a39b7a1483b0460e051e9992bf3435479129e5051bcd go1.21.6.windows-arm64.zip
2424

2525
# version:golangci 1.55.2
2626
# https://github.com/golangci/golangci-lint/releases/

build/nsis.geth.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# - NSIS Large Strings build, http://nsis.sourceforge.net/Special_Builds
2121
# - SFP, http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin (put dll in NSIS\Plugins\x86-ansi)
2222
#
23-
# After intalling NSIS extra the NSIS Large Strings build zip and replace the makensis.exe and the
23+
# After installing NSIS extra the NSIS Large Strings build zip and replace the makensis.exe and the
2424
# files found in Stub.
2525
#
2626
# based on: http://nsis.sourceforge.net/A_simple_installer_with_start_menu_shortcut_and_uninstaller

cmd/devp2p/internal/ethtest/suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ func (s *Suite) EthTests() []utesting.Test {
7676
{Name: "TestMaliciousHandshake", Fn: s.TestMaliciousHandshake},
7777
{Name: "TestMaliciousStatus", Fn: s.TestMaliciousStatus},
7878
// test transactions
79+
{Name: "TestLargeTxRequest", Fn: s.TestLargeTxRequest, Slow: true},
7980
{Name: "TestTransaction", Fn: s.TestTransaction},
8081
{Name: "TestInvalidTxs", Fn: s.TestInvalidTxs},
81-
{Name: "TestLargeTxRequest", Fn: s.TestLargeTxRequest},
8282
{Name: "TestNewPooledTxs", Fn: s.TestNewPooledTxs},
8383
{Name: "TestBlobViolations", Fn: s.TestBlobViolations},
8484
}

cmd/devp2p/internal/ethtest/suite_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ func TestEthSuite(t *testing.T) {
6363
}
6464
for _, test := range suite.EthTests() {
6565
t.Run(test.Name, func(t *testing.T) {
66+
if test.Slow && testing.Short() {
67+
t.Skipf("%s: skipping in -short mode", test.Name)
68+
}
6669
result := utesting.RunTests([]utesting.Test{{Name: test.Name, Fn: test.Fn}}, os.Stdout)
6770
if result[0].Failed {
6871
t.Fatal()

cmd/devp2p/internal/v4test/discv4tests.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ func FindnodeAmplificationWrongIP(t *utesting.T) {
497497
// If we receive a NEIGHBORS response, the attack worked and the test fails.
498498
reply, _, _ := te.read(te.l2)
499499
if reply != nil {
500-
t.Error("Got NEIGHORS response for FINDNODE from wrong IP")
500+
t.Error("Got NEIGHBORS response for FINDNODE from wrong IP")
501501
}
502502
}
503503

cmd/evm/internal/t8ntool/execution.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"github.com/ethereum/go-ethereum/params"
3737
"github.com/ethereum/go-ethereum/rlp"
3838
"github.com/ethereum/go-ethereum/trie"
39+
"github.com/holiman/uint256"
3940
"golang.org/x/crypto/sha3"
4041
)
4142

@@ -311,15 +312,15 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
311312
reward.Sub(reward, new(big.Int).SetUint64(ommer.Delta))
312313
reward.Mul(reward, blockReward)
313314
reward.Div(reward, big.NewInt(8))
314-
statedb.AddBalance(ommer.Address, reward)
315+
statedb.AddBalance(ommer.Address, uint256.MustFromBig(reward))
315316
}
316-
statedb.AddBalance(pre.Env.Coinbase, minerReward)
317+
statedb.AddBalance(pre.Env.Coinbase, uint256.MustFromBig(minerReward))
317318
}
318319
// Apply withdrawals
319320
for _, w := range pre.Env.Withdrawals {
320321
// Amount is in gwei, turn into wei
321322
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(params.GWei))
322-
statedb.AddBalance(w.Address, amount)
323+
statedb.AddBalance(w.Address, uint256.MustFromBig(amount))
323324
}
324325
// Commit block
325326
root, err := statedb.Commit(vmContext.BlockNumber.Uint64(), chainConfig.IsEIP158(vmContext.BlockNumber))
@@ -362,7 +363,7 @@ func MakePreState(db ethdb.Database, accounts core.GenesisAlloc) *state.StateDB
362363
for addr, a := range accounts {
363364
statedb.SetCode(addr, a.Code)
364365
statedb.SetNonce(addr, a.Nonce)
365-
statedb.SetBalance(addr, a.Balance)
366+
statedb.SetBalance(addr, uint256.MustFromBig(a.Balance))
366367
for k, v := range a.Storage {
367368
statedb.SetState(addr, k, v)
368369
}

cmd/evm/internal/t8ntool/transition.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func Transition(ctx *cli.Context) error {
188188
if err != nil {
189189
return err
190190
}
191-
// Dump the excution result
191+
// Dump the execution result
192192
collector := make(Alloc)
193193
s.DumpToCollector(collector, nil)
194194
return dispatchOutput(ctx, baseDir, result, collector, body)
@@ -280,7 +280,7 @@ func (g Alloc) OnAccount(addr *common.Address, dumpAccount state.DumpAccount) {
280280
if addr == nil {
281281
return
282282
}
283-
balance, _ := new(big.Int).SetString(dumpAccount.Balance, 10)
283+
balance, _ := new(big.Int).SetString(dumpAccount.Balance, 0)
284284
var storage map[common.Hash]common.Hash
285285
if dumpAccount.Storage != nil {
286286
storage = make(map[common.Hash]common.Hash)

cmd/geth/logtestcmd_active.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"time"
2727

2828
"github.com/ethereum/go-ethereum/common"
29-
"github.com/ethereum/go-ethereum/internal/debug"
3029
"github.com/ethereum/go-ethereum/log"
3130
"github.com/holiman/uint256"
3231
"github.com/urfave/cli/v2"
@@ -51,9 +50,6 @@ func (c customQuotedStringer) String() string {
5150
// logTest is an entry point which spits out some logs. This is used by testing
5251
// to verify expected outputs
5352
func logTest(ctx *cli.Context) error {
54-
// clear field padding map
55-
debug.ResetLogging()
56-
5753
{ // big.Int
5854
ba, _ := new(big.Int).SetString("111222333444555678999", 10) // "111,222,333,444,555,678,999"
5955
bb, _ := new(big.Int).SetString("-111222333444555678999", 10) // "-111,222,333,444,555,678,999"

cmd/geth/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
1616

17-
// geth is the official command-line client for Ethereum.
17+
// geth is a command-line client for Ethereum.
1818
package main
1919

2020
import (

0 commit comments

Comments
 (0)