Skip to content

Commit 43a1863

Browse files
authored
Merge branch 'ethereum:master' into portal
2 parents f1802d6 + 63aaac8 commit 43a1863

12 files changed

Lines changed: 55 additions & 27 deletions

File tree

cmd/clef/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ There are a couple of implementation for a UI. We'll try to keep this list up to
916916

917917
| Name | Repo | UI type| No external resources| Blocky support| Verifies permissions | Hash information | No secondary storage | Statically linked| Can modify parameters|
918918
| ---- | ---- | -------| ---- | ---- | ---- |---- | ---- | ---- | ---- |
919-
| QtSigner| https://github.com/holiman/qtsigner/| Python3/QT-based| :+1:| :+1:| :+1:| :+1:| :+1:| :x: | :+1: (partially)|
920-
| GtkSigner| https://github.com/holiman/gtksigner| Python3/GTK-based| :+1:| :x:| :x:| :+1:| :+1:| :x: | :x: |
921-
| Frame | https://github.com/floating/frame/commits/go-signer| Electron-based| :x:| :x:| :x:| :x:| ?| :x: | :x: |
922-
| Clef UI| https://github.com/ethereum/clef-ui| Golang/QT-based| :+1:| :+1:| :x:| :+1:| :+1:| :x: | :+1: (approve tx only)|
919+
| QtSigner| https://github.com/holiman/qtsigner/ | Python3/QT-based| :+1:| :+1:| :+1:| :+1:| :+1:| :x: | :+1: (partially)|
920+
| GtkSigner| https://github.com/holiman/gtksigner | Python3/GTK-based| :+1:| :x:| :x:| :+1:| :+1:| :x: | :x: |
921+
| Frame | https://github.com/floating/frame/commits/go-signer | Electron-based| :x:| :x:| :x:| :x:| ?| :x: | :x: |
922+
| Clef UI| https://github.com/ethereum/clef-ui | Golang/QT-based| :+1:| :+1:| :x:| :+1:| :+1:| :x: | :+1: (approve tx only)|

core/txpool/blobpool/blobpool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ func (p *BlobPool) Init(gasTip uint64, head *types.Header, reserve txpool.Addres
402402
}
403403
var (
404404
basefee = uint256.MustFromBig(eip1559.CalcBaseFee(p.chain.Config(), p.head))
405-
blobfee = uint256.MustFromBig(big.NewInt(params.BlobTxMinBlobGasprice))
405+
blobfee = uint256.NewInt(params.BlobTxMinBlobGasprice)
406406
)
407407
if p.head.ExcessBlobGas != nil {
408408
blobfee = uint256.MustFromBig(eip4844.CalcBlobFee(*p.head.ExcessBlobGas))

core/txpool/blobpool/blobpool_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,24 @@ func TestAdd(t *testing.T) {
12281228
},
12291229
},
12301230
},
1231+
// Blob transactions that don't meet the min blob gas price should be rejected
1232+
{
1233+
seeds: map[string]seed{
1234+
"alice": {balance: 10000000},
1235+
},
1236+
adds: []addtx{
1237+
{ // New account, no previous txs, nonce 0, but blob fee cap too low
1238+
from: "alice",
1239+
tx: makeUnsignedTx(0, 1, 1, 0),
1240+
err: txpool.ErrUnderpriced,
1241+
},
1242+
{ // Same as above but blob fee cap equals minimum, should be accepted
1243+
from: "alice",
1244+
tx: makeUnsignedTx(0, 1, 1, params.BlobTxMinBlobGasprice),
1245+
err: nil,
1246+
},
1247+
},
1248+
},
12311249
}
12321250
for i, tt := range tests {
12331251
// Create a temporary folder for the persistent backend

core/txpool/blobpool/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ type Config struct {
3030
// DefaultConfig contains the default configurations for the transaction pool.
3131
var DefaultConfig = Config{
3232
Datadir: "blobpool",
33-
Datacap: 10 * 1024 * 1024 * 1024,
34-
PriceBump: 100, // either have patience or be aggressive, no mushy ground
33+
Datacap: 10 * 1024 * 1024 * 1024 / 4, // TODO(karalabe): /4 handicap for rollout, gradually bump back up to 10GB
34+
PriceBump: 100, // either have patience or be aggressive, no mushy ground
3535
}
3636

3737
// sanitize checks the provided user configurations and changes anything that's

core/txpool/validation.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ import (
3030
"github.com/ethereum/go-ethereum/params"
3131
)
3232

33+
var (
34+
// blobTxMinBlobGasPrice is the big.Int version of the configured protocol
35+
// parameter to avoid constucting a new big integer for every transaction.
36+
blobTxMinBlobGasPrice = big.NewInt(params.BlobTxMinBlobGasprice)
37+
)
38+
3339
// ValidationOptions define certain differences between transaction validation
3440
// across the different pools without having to duplicate those checks.
3541
type ValidationOptions struct {
@@ -101,15 +107,17 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
101107
return err
102108
}
103109
if tx.Gas() < intrGas {
104-
return fmt.Errorf("%w: needed %v, allowed %v", core.ErrIntrinsicGas, intrGas, tx.Gas())
110+
return fmt.Errorf("%w: gas %v, minimum needed %v", core.ErrIntrinsicGas, tx.Gas(), intrGas)
105111
}
106-
// Ensure the gasprice is high enough to cover the requirement of the calling
107-
// pool and/or block producer
112+
// Ensure the gasprice is high enough to cover the requirement of the calling pool
108113
if tx.GasTipCapIntCmp(opts.MinTip) < 0 {
109-
return fmt.Errorf("%w: tip needed %v, tip permitted %v", ErrUnderpriced, opts.MinTip, tx.GasTipCap())
114+
return fmt.Errorf("%w: gas tip cap %v, minimum needed %v", ErrUnderpriced, tx.GasTipCap(), opts.MinTip)
110115
}
111-
// Ensure blob transactions have valid commitments
112116
if tx.Type() == types.BlobTxType {
117+
// Ensure the blob fee cap satisfies the minimum blob gas price
118+
if tx.BlobGasFeeCapIntCmp(blobTxMinBlobGasPrice) < 0 {
119+
return fmt.Errorf("%w: blob fee cap %v, minimum needed %v", ErrUnderpriced, tx.BlobGasFeeCap(), blobTxMinBlobGasPrice)
120+
}
113121
sidecar := tx.BlobTxSidecar()
114122
if sidecar == nil {
115123
return fmt.Errorf("missing sidecar in blob transaction")
@@ -123,6 +131,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
123131
if len(hashes) > params.MaxBlobGasPerBlock/params.BlobTxBlobGasPerBlob {
124132
return fmt.Errorf("too many blobs in transaction: have %d, permitted %d", len(hashes), params.MaxBlobGasPerBlock/params.BlobTxBlobGasPerBlob)
125133
}
134+
// Ensure commitments, proofs and hashes are valid
126135
if err := validateBlobSidecar(hashes, sidecar); err != nil {
127136
return err
128137
}

eth/catalyst/api.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,7 @@ func getBody(block *types.Block) *engine.ExecutionPayloadBodyV1 {
879879
)
880880

881881
for j, tx := range body.Transactions {
882-
data, _ := tx.MarshalBinary()
883-
txs[j] = hexutil.Bytes(data)
882+
txs[j], _ = tx.MarshalBinary()
884883
}
885884

886885
// Post-shanghai withdrawals MUST be set to empty slice instead of nil

eth/catalyst/api_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,8 @@ func TestInvalidPayloadTimestamp(t *testing.T) {
262262
{0, true},
263263
{parent.Time, true},
264264
{parent.Time - 1, true},
265-
266-
// TODO (MariusVanDerWijden) following tests are currently broken,
267-
// fixed in upcoming merge-kiln-v2 pr
268-
//{parent.Time() + 1, false},
269-
//{uint64(time.Now().Unix()) + uint64(time.Minute), false},
265+
{parent.Time + 1, false},
266+
{uint64(time.Now().Unix()) + uint64(time.Minute), false},
270267
}
271268

272269
for i, test := range tests {

internal/ethapi/transaction_args.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend, skipGas
156156
Value: args.Value,
157157
Data: (*hexutil.Bytes)(&data),
158158
AccessList: args.AccessList,
159+
BlobFeeCap: args.BlobFeeCap,
160+
BlobHashes: args.BlobHashes,
159161
}
160162
latestBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)
161163
estimated, err := DoEstimateGas(ctx, b, callArgs, latestBlockNr, nil, b.RPCGasCap())

log/logger_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package log
22

33
import (
44
"bytes"
5+
"errors"
56
"fmt"
67
"io"
78
"math/big"
@@ -77,7 +78,7 @@ func benchmarkLogger(b *testing.B, l Logger) {
7778
tt = time.Now()
7879
bigint = big.NewInt(100)
7980
nilbig *big.Int
80-
err = fmt.Errorf("Oh nooes it's crap")
81+
err = errors.New("Oh nooes it's crap")
8182
)
8283
b.ReportAllocs()
8384
b.ResetTimer()
@@ -106,7 +107,7 @@ func TestLoggerOutput(t *testing.T) {
106107
tt = time.Time{}
107108
bigint = big.NewInt(100)
108109
nilbig *big.Int
109-
err = fmt.Errorf("Oh nooes it's crap")
110+
err = errors.New("Oh nooes it's crap")
110111
smallUint = uint256.NewInt(500_000)
111112
bigUint = &uint256.Int{0xff, 0xff, 0xff, 0xff}
112113
)

p2p/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,13 +914,13 @@ func (srv *Server) checkInboundConn(remoteIP net.IP) error {
914914
}
915915
// Reject connections that do not match NetRestrict.
916916
if srv.NetRestrict != nil && !srv.NetRestrict.Contains(remoteIP) {
917-
return fmt.Errorf("not in netrestrict list")
917+
return errors.New("not in netrestrict list")
918918
}
919919
// Reject Internet peers that try too often.
920920
now := srv.clock.Now()
921921
srv.inboundHistory.expire(now, nil)
922922
if !netutil.IsLAN(remoteIP) && srv.inboundHistory.contains(remoteIP.String()) {
923-
return fmt.Errorf("too many attempts")
923+
return errors.New("too many attempts")
924924
}
925925
srv.inboundHistory.add(remoteIP.String(), now.Add(inboundThrottleTime))
926926
return nil

0 commit comments

Comments
 (0)