core/txpool,internal/ethapi: fixup a few nits

This commit is contained in:
lightclient 2025-08-25 13:45:47 -06:00
parent 3e4ed1cdc0
commit 1a887a2155
No known key found for this signature in database
GPG key ID: 657913021EF45A6A
4 changed files with 7 additions and 26 deletions

View file

@ -1398,7 +1398,7 @@ func (p *BlobPool) AvailableBlobs(vhashes []common.Hash) int {
}
// convertSidecar converts the legacy sidecar in the submitted transactions
// if osaka fork has been activated.
// if Osaka fork has been activated.
func (p *BlobPool) convertSidecar(txs []*types.Transaction) ([]*types.Transaction, []error) {
head := p.chain.CurrentBlock()
if !p.chain.Config().IsOsaka(head.Number, head.Time) {

View file

@ -1705,25 +1705,8 @@ func TestAddLegacyBlobTx(t *testing.T) {
statedb.AddBalance(addr2, uint256.NewInt(1_000_000_000), tracing.BalanceChangeUnspecified)
statedb.Commit(0, true, false)
// Make Prague-enabled custom chain config.
cancunTime := uint64(0)
pragueTime := uint64(0)
osakaTime := uint64(0)
config := &params.ChainConfig{
ChainID: big.NewInt(1),
LondonBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
CancunTime: &cancunTime,
PragueTime: &pragueTime,
OsakaTime: &osakaTime,
BlobScheduleConfig: &params.BlobScheduleConfig{
Cancun: params.DefaultCancunBlobConfig,
Prague: params.DefaultPragueBlobConfig,
Osaka: params.DefaultOsakaBlobConfig,
},
}
chain := &testBlockChain{
config: config,
config: params.MergedTestChainConfig,
basefee: uint256.NewInt(1050),
blobfee: uint256.NewInt(105),
statedb: statedb,

View file

@ -1521,9 +1521,8 @@ func (api *TransactionAPI) FillTransaction(ctx context.Context, args Transaction
// Set some sanity defaults and terminate on failure
sidecarVersion := types.BlobSidecarVersion0
if len(args.Blobs) > 0 {
chainHead := api.b.CurrentHeader()
isOsaka := api.b.ChainConfig().IsOsaka(chainHead.Number, chainHead.Time)
if isOsaka {
h := api.b.CurrentHeader()
if api.b.ChainConfig().IsOsaka(h.Number, h.Time) {
sidecarVersion = types.BlobSidecarVersion1
}
}
@ -1599,9 +1598,8 @@ func (api *TransactionAPI) SignTransaction(ctx context.Context, args Transaction
}
sidecarVersion := types.BlobSidecarVersion0
if len(args.Blobs) > 0 {
chainHead := api.b.CurrentHeader()
isOsaka := api.b.ChainConfig().IsOsaka(chainHead.Number, chainHead.Time)
if isOsaka {
h := api.b.CurrentHeader()
if api.b.ChainConfig().IsOsaka(h.Number, h.Time) {
sidecarVersion = types.BlobSidecarVersion1
}
}

View file

@ -162,7 +162,7 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend, config
return err
}
args.Gas = &estimated
log.Trace("Estimate gas usage automatically", "gas", args.Gas)
log.Trace("Estimated gas usage automatically", "gas", args.Gas)
}
// If chain id is provided, ensure it matches the local chain id. Otherwise, set the local