mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 21:56:43 +00:00
core/txpool,internal/ethapi: fixup a few nits
This commit is contained in:
parent
3e4ed1cdc0
commit
1a887a2155
4 changed files with 7 additions and 26 deletions
|
|
@ -1398,7 +1398,7 @@ func (p *BlobPool) AvailableBlobs(vhashes []common.Hash) int {
|
||||||
}
|
}
|
||||||
|
|
||||||
// convertSidecar converts the legacy sidecar in the submitted transactions
|
// 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) {
|
func (p *BlobPool) convertSidecar(txs []*types.Transaction) ([]*types.Transaction, []error) {
|
||||||
head := p.chain.CurrentBlock()
|
head := p.chain.CurrentBlock()
|
||||||
if !p.chain.Config().IsOsaka(head.Number, head.Time) {
|
if !p.chain.Config().IsOsaka(head.Number, head.Time) {
|
||||||
|
|
|
||||||
|
|
@ -1705,25 +1705,8 @@ func TestAddLegacyBlobTx(t *testing.T) {
|
||||||
statedb.AddBalance(addr2, uint256.NewInt(1_000_000_000), tracing.BalanceChangeUnspecified)
|
statedb.AddBalance(addr2, uint256.NewInt(1_000_000_000), tracing.BalanceChangeUnspecified)
|
||||||
statedb.Commit(0, true, false)
|
statedb.Commit(0, true, false)
|
||||||
|
|
||||||
// Make Prague-enabled custom chain config.
|
|
||||||
cancunTime := uint64(0)
|
|
||||||
pragueTime := uint64(0)
|
|
||||||
osakaTime := uint64(0)
|
|
||||||
config := ¶ms.ChainConfig{
|
|
||||||
ChainID: big.NewInt(1),
|
|
||||||
LondonBlock: big.NewInt(0),
|
|
||||||
BerlinBlock: big.NewInt(0),
|
|
||||||
CancunTime: &cancunTime,
|
|
||||||
PragueTime: &pragueTime,
|
|
||||||
OsakaTime: &osakaTime,
|
|
||||||
BlobScheduleConfig: ¶ms.BlobScheduleConfig{
|
|
||||||
Cancun: params.DefaultCancunBlobConfig,
|
|
||||||
Prague: params.DefaultPragueBlobConfig,
|
|
||||||
Osaka: params.DefaultOsakaBlobConfig,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
chain := &testBlockChain{
|
chain := &testBlockChain{
|
||||||
config: config,
|
config: params.MergedTestChainConfig,
|
||||||
basefee: uint256.NewInt(1050),
|
basefee: uint256.NewInt(1050),
|
||||||
blobfee: uint256.NewInt(105),
|
blobfee: uint256.NewInt(105),
|
||||||
statedb: statedb,
|
statedb: statedb,
|
||||||
|
|
|
||||||
|
|
@ -1521,9 +1521,8 @@ func (api *TransactionAPI) FillTransaction(ctx context.Context, args Transaction
|
||||||
// Set some sanity defaults and terminate on failure
|
// Set some sanity defaults and terminate on failure
|
||||||
sidecarVersion := types.BlobSidecarVersion0
|
sidecarVersion := types.BlobSidecarVersion0
|
||||||
if len(args.Blobs) > 0 {
|
if len(args.Blobs) > 0 {
|
||||||
chainHead := api.b.CurrentHeader()
|
h := api.b.CurrentHeader()
|
||||||
isOsaka := api.b.ChainConfig().IsOsaka(chainHead.Number, chainHead.Time)
|
if api.b.ChainConfig().IsOsaka(h.Number, h.Time) {
|
||||||
if isOsaka {
|
|
||||||
sidecarVersion = types.BlobSidecarVersion1
|
sidecarVersion = types.BlobSidecarVersion1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1599,9 +1598,8 @@ func (api *TransactionAPI) SignTransaction(ctx context.Context, args Transaction
|
||||||
}
|
}
|
||||||
sidecarVersion := types.BlobSidecarVersion0
|
sidecarVersion := types.BlobSidecarVersion0
|
||||||
if len(args.Blobs) > 0 {
|
if len(args.Blobs) > 0 {
|
||||||
chainHead := api.b.CurrentHeader()
|
h := api.b.CurrentHeader()
|
||||||
isOsaka := api.b.ChainConfig().IsOsaka(chainHead.Number, chainHead.Time)
|
if api.b.ChainConfig().IsOsaka(h.Number, h.Time) {
|
||||||
if isOsaka {
|
|
||||||
sidecarVersion = types.BlobSidecarVersion1
|
sidecarVersion = types.BlobSidecarVersion1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend, config
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
args.Gas = &estimated
|
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
|
// If chain id is provided, ensure it matches the local chain id. Otherwise, set the local
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue