Skip to content

Commit bd10544

Browse files
committed
Merge tag 'v1.13.14' into axel/1_13_14_merge
2 parents c0db628 + 2bd6bd0 commit bd10544

File tree

19 files changed

+113
-74
lines changed

19 files changed

+113
-74
lines changed

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, p.head.Time+1))
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/errors.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,10 @@ var (
5454
// ErrFutureReplacePending is returned if a future transaction replaces a pending
5555
// one. Future transactions should only be able to replace other future transactions.
5656
ErrFutureReplacePending = errors.New("future transaction tries to replace pending")
57+
58+
// ErrAlreadyReserved is returned if the sender address has a pending transaction
59+
// in a different subpool. For example, this error is returned in response to any
60+
// input transaction of non-blob type when a blob transaction from this sender
61+
// remains pending (and vice-versa).
62+
ErrAlreadyReserved = errors.New("address already reserved")
5763
)

core/txpool/legacypool/journal.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ func (journal *journal) rotate(all map[common.Address]types.Transactions) error
164164
return err
165165
}
166166
journal.writer = sink
167-
log.Info("Regenerated local transaction journal", "transactions", journaled, "accounts", len(all))
167+
168+
logger := log.Info
169+
if len(all) == 0 {
170+
logger = log.Debug
171+
}
172+
logger("Regenerated local transaction journal", "transactions", journaled, "accounts", len(all))
168173

169174
return nil
170175
}

core/txpool/txpool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (p *TxPool) reserver(id int, subpool SubPool) AddressReserver {
124124
log.Error("pool attempted to reserve already-owned address", "address", addr)
125125
return nil // Ignore fault to give the pool a chance to recover while the bug gets fixed
126126
}
127-
return errors.New("address already reserved")
127+
return ErrAlreadyReserved
128128
}
129129
p.reservations[addr] = subpool
130130
if metrics.Enabled {

core/txpool/validation.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ import (
3535
// are not able to consume all of the gas in a L2 block as the L1 info deposit is always present.
3636
const l1InfoGasOverhead = uint64(70_000)
3737

38+
var (
39+
// blobTxMinBlobGasPrice is the big.Int version of the configured protocol
40+
// parameter to avoid constucting a new big integer for every transaction.
41+
blobTxMinBlobGasPrice = big.NewInt(params.BlobTxMinBlobGasprice)
42+
)
43+
3844
func EffectiveGasLimit(chainConfig *params.ChainConfig, gasLimit uint64, effectiveLimit uint64) uint64 {
3945
if effectiveLimit != 0 && effectiveLimit < gasLimit {
4046
gasLimit = effectiveLimit
@@ -131,15 +137,17 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
131137
return err
132138
}
133139
if tx.Gas() < intrGas {
134-
return fmt.Errorf("%w: needed %v, allowed %v", core.ErrIntrinsicGas, intrGas, tx.Gas())
140+
return fmt.Errorf("%w: gas %v, minimum needed %v", core.ErrIntrinsicGas, tx.Gas(), intrGas)
135141
}
136-
// Ensure the gasprice is high enough to cover the requirement of the calling
137-
// pool and/or block producer
142+
// Ensure the gasprice is high enough to cover the requirement of the calling pool
138143
if tx.GasTipCapIntCmp(opts.MinTip) < 0 {
139-
return fmt.Errorf("%w: tip needed %v, tip permitted %v", ErrUnderpriced, opts.MinTip, tx.GasTipCap())
144+
return fmt.Errorf("%w: gas tip cap %v, minimum needed %v", ErrUnderpriced, tx.GasTipCap(), opts.MinTip)
140145
}
141-
// Ensure blob transactions have valid commitments
142146
if tx.Type() == types.BlobTxType {
147+
// Ensure the blob fee cap satisfies the minimum blob gas price
148+
if tx.BlobGasFeeCapIntCmp(blobTxMinBlobGasPrice) < 0 {
149+
return fmt.Errorf("%w: blob fee cap %v, minimum needed %v", ErrUnderpriced, tx.BlobGasFeeCap(), blobTxMinBlobGasPrice)
150+
}
143151
sidecar := tx.BlobTxSidecar()
144152
if sidecar == nil {
145153
return fmt.Errorf("missing sidecar in blob transaction")
@@ -153,6 +161,7 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
153161
if len(hashes) > params.MaxBlobGasPerBlock/params.BlobTxBlobGasPerBlob {
154162
return fmt.Errorf("too many blobs in transaction: have %d, permitted %d", len(hashes), params.MaxBlobGasPerBlock/params.BlobTxBlobGasPerBlob)
155163
}
164+
// Ensure commitments, proofs and hashes are valid
156165
if err := validateBlobSidecar(hashes, sidecar); err != nil {
157166
return err
158167
}

eth/catalyst/api.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ func (api *ConsensusAPI) NewPayloadV1(params engine.ExecutableData) (engine.Payl
502502
// NewPayloadV2 creates an Eth1 block, inserts it in the chain, and returns the status of the chain.
503503
func (api *ConsensusAPI) NewPayloadV2(params engine.ExecutableData) (engine.PayloadStatusV1, error) {
504504
if api.eth.BlockChain().Config().IsCancun(api.eth.BlockChain().Config().LondonBlock, params.Timestamp) {
505-
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("can't use new payload v2 post-shanghai"))
505+
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("can't use newPayloadV2 post-cancun"))
506506
}
507507
if api.eth.BlockChain().Config().LatestFork(params.Timestamp) == forks.Shanghai {
508508
if params.Withdrawals == nil {
@@ -517,7 +517,7 @@ func (api *ConsensusAPI) NewPayloadV2(params engine.ExecutableData) (engine.Payl
517517
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("non-nil excessBlobGas pre-cancun"))
518518
}
519519
if params.BlobGasUsed != nil {
520-
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("non-nil params.BlobGasUsed pre-cancun"))
520+
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("non-nil blobGasUsed pre-cancun"))
521521
}
522522
return api.newPayload(params, nil, nil)
523523
}
@@ -531,14 +531,14 @@ func (api *ConsensusAPI) NewPayloadV3(params engine.ExecutableData, versionedHas
531531
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil excessBlobGas post-cancun"))
532532
}
533533
if params.BlobGasUsed == nil {
534-
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil params.BlobGasUsed post-cancun"))
534+
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil blobGasUsed post-cancun"))
535535
}
536536

537537
if versionedHashes == nil {
538538
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil versionedHashes post-cancun"))
539539
}
540540
if beaconRoot == nil {
541-
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil parentBeaconBlockRoot post-cancun"))
541+
return engine.PayloadStatusV1{Status: engine.INVALID}, engine.InvalidParams.With(errors.New("nil beaconRoot post-cancun"))
542542
}
543543

544544
if api.eth.BlockChain().Config().LatestFork(params.Timestamp) != forks.Cancun {
@@ -896,8 +896,7 @@ func getBody(block *types.Block) *engine.ExecutionPayloadBodyV1 {
896896
)
897897

898898
for j, tx := range body.Transactions {
899-
data, _ := tx.MarshalBinary()
900-
txs[j] = hexutil.Bytes(data)
899+
txs[j], _ = tx.MarshalBinary()
901900
}
902901

903902
// 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
@@ -264,11 +264,8 @@ func TestInvalidPayloadTimestamp(t *testing.T) {
264264
{0, true},
265265
{parent.Time, true},
266266
{parent.Time - 1, true},
267-
268-
// TODO (MariusVanDerWijden) following tests are currently broken,
269-
// fixed in upcoming merge-kiln-v2 pr
270-
//{parent.Time() + 1, false},
271-
//{uint64(time.Now().Unix()) + uint64(time.Minute), false},
267+
{parent.Time + 1, false},
268+
{uint64(time.Now().Unix()) + uint64(time.Minute), false},
272269
}
273270

274271
for i, test := range tests {

0 commit comments

Comments
 (0)