Skip to content

Commit 8f7eb9c

Browse files
authored
all: release go-ethereum v1.13.11 (#28868)
Release 1.13.11
2 parents bc0be1b + 99dc3fe commit 8f7eb9c

File tree

164 files changed

+2405
-1625
lines changed

Some content is hidden

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

164 files changed

+2405
-1625
lines changed

.github/workflows/go.yml

+1-1
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

+2-2
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

+1-1
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

+2-4
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

+1-1
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

beacon/engine/types.go

+25
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

+15-15
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

+1-1
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

+1-1
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

+3
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

+1-1
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

+5-4
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

@@ -308,15 +309,15 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
308309
reward.Sub(reward, new(big.Int).SetUint64(ommer.Delta))
309310
reward.Mul(reward, blockReward)
310311
reward.Div(reward, big.NewInt(8))
311-
statedb.AddBalance(ommer.Address, reward)
312+
statedb.AddBalance(ommer.Address, uint256.MustFromBig(reward))
312313
}
313-
statedb.AddBalance(pre.Env.Coinbase, minerReward)
314+
statedb.AddBalance(pre.Env.Coinbase, uint256.MustFromBig(minerReward))
314315
}
315316
// Apply withdrawals
316317
for _, w := range pre.Env.Withdrawals {
317318
// Amount is in gwei, turn into wei
318319
amount := new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(params.GWei))
319-
statedb.AddBalance(w.Address, amount)
320+
statedb.AddBalance(w.Address, uint256.MustFromBig(amount))
320321
}
321322
// Commit block
322323
root, err := statedb.Commit(vmContext.BlockNumber.Uint64(), chainConfig.IsEIP158(vmContext.BlockNumber))
@@ -359,7 +360,7 @@ func MakePreState(db ethdb.Database, accounts core.GenesisAlloc) *state.StateDB
359360
for addr, a := range accounts {
360361
statedb.SetCode(addr, a.Code)
361362
statedb.SetNonce(addr, a.Nonce)
362-
statedb.SetBalance(addr, a.Balance)
363+
statedb.SetBalance(addr, uint256.MustFromBig(a.Balance))
363364
for k, v := range a.Storage {
364365
statedb.SetState(addr, k, v)
365366
}

cmd/evm/internal/t8ntool/transition.go

+2-2
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

-4
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

+1-1
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 (

cmd/rlpdump/main.go

+54-9
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import (
2525
"flag"
2626
"fmt"
2727
"io"
28+
"math"
2829
"os"
30+
"strconv"
2931
"strings"
3032

3133
"github.com/ethereum/go-ethereum/common"
@@ -37,6 +39,7 @@ var (
3739
reverseMode = flag.Bool("reverse", false, "convert ASCII to rlp")
3840
noASCII = flag.Bool("noascii", false, "don't print ASCII strings readably")
3941
single = flag.Bool("single", false, "print only the first element, discard the rest")
42+
showpos = flag.Bool("pos", false, "display element byte posititions")
4043
)
4144

4245
func init() {
@@ -52,31 +55,37 @@ If the filename is omitted, data is read from stdin.`)
5255
func main() {
5356
flag.Parse()
5457

55-
var r io.Reader
58+
var r *inStream
5659
switch {
5760
case *hexMode != "":
5861
data, err := hex.DecodeString(strings.TrimPrefix(*hexMode, "0x"))
5962
if err != nil {
6063
die(err)
6164
}
62-
r = bytes.NewReader(data)
65+
r = newInStream(bytes.NewReader(data), int64(len(data)))
6366

6467
case flag.NArg() == 0:
65-
r = os.Stdin
68+
r = newInStream(bufio.NewReader(os.Stdin), 0)
6669

6770
case flag.NArg() == 1:
6871
fd, err := os.Open(flag.Arg(0))
6972
if err != nil {
7073
die(err)
7174
}
7275
defer fd.Close()
73-
r = fd
76+
var size int64
77+
finfo, err := fd.Stat()
78+
if err == nil {
79+
size = finfo.Size()
80+
}
81+
r = newInStream(bufio.NewReader(fd), size)
7482

7583
default:
7684
fmt.Fprintln(os.Stderr, "Error: too many arguments")
7785
flag.Usage()
7886
os.Exit(2)
7987
}
88+
8089
out := os.Stdout
8190
if *reverseMode {
8291
data, err := textToRlp(r)
@@ -93,10 +102,10 @@ func main() {
93102
}
94103
}
95104

96-
func rlpToText(r io.Reader, out io.Writer) error {
97-
s := rlp.NewStream(r, 0)
105+
func rlpToText(in *inStream, out io.Writer) error {
106+
stream := rlp.NewStream(in, 0)
98107
for {
99-
if err := dump(s, 0, out); err != nil {
108+
if err := dump(in, stream, 0, out); err != nil {
100109
if err != io.EOF {
101110
return err
102111
}
@@ -110,7 +119,10 @@ func rlpToText(r io.Reader, out io.Writer) error {
110119
return nil
111120
}
112121

113-
func dump(s *rlp.Stream, depth int, out io.Writer) error {
122+
func dump(in *inStream, s *rlp.Stream, depth int, out io.Writer) error {
123+
if *showpos {
124+
fmt.Fprintf(out, "%s: ", in.posLabel())
125+
}
114126
kind, size, err := s.Kind()
115127
if err != nil {
116128
return err
@@ -137,7 +149,7 @@ func dump(s *rlp.Stream, depth int, out io.Writer) error {
137149
if i > 0 {
138150
fmt.Fprint(out, ",\n")
139151
}
140-
if err := dump(s, depth+1, out); err == rlp.EOL {
152+
if err := dump(in, s, depth+1, out); err == rlp.EOL {
141153
break
142154
} else if err != nil {
143155
return err
@@ -208,3 +220,36 @@ func textToRlp(r io.Reader) ([]byte, error) {
208220
data, err := rlp.EncodeToBytes(obj[0])
209221
return data, err
210222
}
223+
224+
type inStream struct {
225+
br rlp.ByteReader
226+
pos int
227+
columns int
228+
}
229+
230+
func newInStream(br rlp.ByteReader, totalSize int64) *inStream {
231+
col := int(math.Ceil(math.Log10(float64(totalSize))))
232+
return &inStream{br: br, columns: col}
233+
}
234+
235+
func (rc *inStream) Read(b []byte) (n int, err error) {
236+
n, err = rc.br.Read(b)
237+
rc.pos += n
238+
return n, err
239+
}
240+
241+
func (rc *inStream) ReadByte() (byte, error) {
242+
b, err := rc.br.ReadByte()
243+
if err == nil {
244+
rc.pos++
245+
}
246+
return b, err
247+
}
248+
249+
func (rc *inStream) posLabel() string {
250+
l := strconv.FormatInt(int64(rc.pos), 10)
251+
if len(l) < rc.columns {
252+
l = strings.Repeat(" ", rc.columns-len(l)) + l
253+
}
254+
return l
255+
}

0 commit comments

Comments
 (0)