Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 677a32d

Browse files
committed
merge v1.13.11
1 parent ae7357b commit 677a32d

File tree

173 files changed

+3244
-2581
lines changed

Some content is hidden

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

173 files changed

+3244
-2581
lines changed

.github/workflows/go.yml

+2-54
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v3
2020
with:
21-
go-version: ^1.20
21+
go-version: ^1.21.4
2222
id: go
2323

2424
- name: Check out code into the Go module directory
@@ -51,59 +51,7 @@ jobs:
5151
uses: actions/checkout@v2
5252

5353
- name: Test
54-
run: go test ./core ./miner/... ./internal/ethapi/... ./les/... ./builder/... ./eth/block-validation/...
54+
run: go test ./core ./miner/... ./internal/ethapi/... ./builder/... ./eth/block-validation/...
5555

5656
- name: Build
5757
run: make geth
58-
59-
e2e:
60-
name: End to End
61-
runs-on: ubuntu-latest
62-
timeout-minutes: 20
63-
steps:
64-
65-
- name: Set up Go 1.x
66-
uses: actions/setup-go@v3
67-
with:
68-
go-version: ^1.20
69-
id: go
70-
71-
- name: Use Node.js 12.x
72-
uses: actions/setup-node@v1
73-
with:
74-
node-version: 12.x
75-
76-
- name: Check out code into the Go module directory
77-
uses: actions/checkout@v2
78-
79-
- name: Build
80-
run: make geth
81-
82-
- name: Check out the e2e code repo
83-
uses: actions/checkout@v2
84-
with:
85-
repository: flashbots/mev-geth-demo
86-
ref: no-megabundles
87-
path: e2e
88-
89-
- run: cd e2e && yarn install
90-
- name: Run single node e2e
91-
run: |
92-
cd e2e
93-
GETH=`pwd`/../build/bin/geth ./run.sh &
94-
sleep 15
95-
yarn run demo-simple
96-
yarn run e2e-reverting-bundles
97-
yarn run demo-contract
98-
pkill -9 geth || true
99-
- name: Run private tx with two nodes
100-
run: |
101-
cd e2e
102-
GETH=`pwd`/../build/bin/geth ./run.sh &
103-
# Second node, not mining
104-
P2P_PORT=30302 DATADIR=datadir2 HTTP_PORT=8546 AUTH_PORT=8552 MINER_ARGS='--nodiscover' GETH=`pwd`/../build/bin/geth ./run.sh &
105-
sleep 15
106-
DATADIR1=datadir DATADIR2=datadir2 GETH=`pwd`/../build/bin/geth ./peer_nodes.sh
107-
sleep 15
108-
yarn run demo-private-tx
109-
pkill -9 geth || true

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

+4-9
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/ethereum/go-ethereum/common"
2929
"github.com/ethereum/go-ethereum/common/hexutil"
3030
"github.com/ethereum/go-ethereum/core/types"
31-
"github.com/ethereum/go-ethereum/params"
31+
"github.com/ethereum/go-ethereum/crypto/kzg4844"
3232
"github.com/ethereum/go-ethereum/trie"
3333
)
3434

@@ -406,14 +406,9 @@ func ExecutionPayloadV3ToBlock(payload *deneb.ExecutionPayload, blobsBundle *den
406406
hasher := sha256.New()
407407
versionedHashes := make([]common.Hash, len(blobsBundle.Commitments))
408408
for i, commitment := range blobsBundle.Commitments {
409-
hasher.Write(commitment[:])
410-
hash := hasher.Sum(nil)
411-
hasher.Reset()
412-
413-
var vhash common.Hash
414-
vhash[0] = params.BlobTxHashVersion
415-
copy(vhash[1:], hash[1:])
416-
versionedHashes[i] = vhash
409+
c := kzg4844.Commitment(commitment)
410+
computed := kzg4844.CalcBlobHashV1(hasher, &c)
411+
versionedHashes[i] = common.Hash(computed)
417412
}
418413

419414
executableData := ExecutableData{

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

builder/relay.go

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"errors"
66
"fmt"
77
"net/http"
8+
"os"
89
"strings"
910
"sync"
1011
"time"
@@ -152,6 +153,17 @@ func (r *RemoteRelay) SubmitBlock(msg *builderSpec.VersionedSubmitBlockRequest,
152153
bodyBytes, err = msg.Capella.MarshalSSZ()
153154
case spec.DataVersionDeneb:
154155
bodyBytes, err = msg.Deneb.MarshalSSZ()
156+
if len(msg.Deneb.BlobsBundle.Blobs) > 0 {
157+
jsonBid, _ := msg.Deneb.MarshalJSON()
158+
err := os.WriteFile("/home/ubuntu/submitBlockPayloadDeneb_Goerli.json", jsonBid, 0644)
159+
if err != nil {
160+
fmt.Println("Error writing JSON to file:", err)
161+
}
162+
err = os.WriteFile("/home/ubuntu/submitBlockPayloadDeneb_Goerli.ssz", bodyBytes, 0644)
163+
if err != nil {
164+
fmt.Println("Error writing SSZ to file:", err)
165+
}
166+
}
155167
default:
156168
return fmt.Errorf("unknown data version %d", msg.Version)
157169
}

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 (

0 commit comments

Comments
 (0)