mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 00:43:46 +00:00
Improve oversized block handling (#315)
* improve oversized block handling * bump version
This commit is contained in:
parent
c913b3e2f1
commit
27a3830afa
3 changed files with 37 additions and 27 deletions
|
|
@ -837,7 +837,8 @@ func (w *worker) commitTransactions(txs *types.TransactionsByPriceAndNonce, coin
|
||||||
}
|
}
|
||||||
if !w.chainConfig.Scroll.IsValidBlockSize(w.current.blockSize + tx.Size()) {
|
if !w.chainConfig.Scroll.IsValidBlockSize(w.current.blockSize + tx.Size()) {
|
||||||
log.Trace("Block size limit reached", "have", w.current.blockSize, "want", w.chainConfig.Scroll.MaxTxPayloadBytesPerBlock, "tx", tx.Size())
|
log.Trace("Block size limit reached", "have", w.current.blockSize, "want", w.chainConfig.Scroll.MaxTxPayloadBytesPerBlock, "tx", tx.Size())
|
||||||
break
|
txs.Pop() // skip transactions from this account
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
// Error may be ignored here. The error has already been checked
|
// Error may be ignored here. The error has already been checked
|
||||||
// during transaction acceptance is the transaction pool.
|
// during transaction acceptance is the transaction pool.
|
||||||
|
|
|
||||||
|
|
@ -296,11 +296,12 @@ var (
|
||||||
// adding flags to the config to also have to set these fields.
|
// adding flags to the config to also have to set these fields.
|
||||||
AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil,
|
AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil,
|
||||||
ScrollConfig{
|
ScrollConfig{
|
||||||
UseZktrie: false,
|
UseZktrie: false,
|
||||||
FeeVaultAddress: nil,
|
FeeVaultAddress: nil,
|
||||||
EnableEIP2718: true,
|
EnableEIP2718: true,
|
||||||
EnableEIP1559: true,
|
EnableEIP1559: true,
|
||||||
MaxTxPerBlock: nil,
|
MaxTxPerBlock: nil,
|
||||||
|
MaxTxPayloadBytesPerBlock: nil,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
||||||
|
|
@ -310,30 +311,33 @@ var (
|
||||||
// adding flags to the config to also have to set these fields.
|
// adding flags to the config to also have to set these fields.
|
||||||
AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000},
|
AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, &CliqueConfig{Period: 0, Epoch: 30000},
|
||||||
ScrollConfig{
|
ScrollConfig{
|
||||||
UseZktrie: false,
|
UseZktrie: false,
|
||||||
FeeVaultAddress: nil,
|
FeeVaultAddress: nil,
|
||||||
EnableEIP2718: true,
|
EnableEIP2718: true,
|
||||||
EnableEIP1559: true,
|
EnableEIP1559: true,
|
||||||
MaxTxPerBlock: nil,
|
MaxTxPerBlock: nil,
|
||||||
|
MaxTxPayloadBytesPerBlock: nil,
|
||||||
}}
|
}}
|
||||||
|
|
||||||
TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil,
|
TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil,
|
||||||
ScrollConfig{
|
ScrollConfig{
|
||||||
UseZktrie: false,
|
UseZktrie: false,
|
||||||
FeeVaultAddress: &common.Address{123},
|
FeeVaultAddress: &common.Address{123},
|
||||||
EnableEIP2718: true,
|
EnableEIP2718: true,
|
||||||
EnableEIP1559: true,
|
EnableEIP1559: true,
|
||||||
MaxTxPerBlock: nil,
|
MaxTxPerBlock: nil,
|
||||||
|
MaxTxPayloadBytesPerBlock: nil,
|
||||||
}}
|
}}
|
||||||
TestRules = TestChainConfig.Rules(new(big.Int))
|
TestRules = TestChainConfig.Rules(new(big.Int))
|
||||||
|
|
||||||
TestNoL1feeChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil,
|
TestNoL1feeChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil,
|
||||||
ScrollConfig{
|
ScrollConfig{
|
||||||
UseZktrie: false,
|
UseZktrie: false,
|
||||||
FeeVaultAddress: nil,
|
FeeVaultAddress: nil,
|
||||||
EnableEIP2718: true,
|
EnableEIP2718: true,
|
||||||
EnableEIP1559: true,
|
EnableEIP1559: true,
|
||||||
MaxTxPerBlock: nil,
|
MaxTxPerBlock: nil,
|
||||||
|
MaxTxPayloadBytesPerBlock: nil,
|
||||||
}}
|
}}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -459,13 +463,18 @@ func (s ScrollConfig) ZktrieEnabled() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ScrollConfig) String() string {
|
func (s ScrollConfig) String() string {
|
||||||
if s.MaxTxPerBlock == nil {
|
maxTxPerBlock := "<nil>"
|
||||||
return fmt.Sprintf("{useZktrie: %v, maxTxPerBlock: <nil>, feeVaultAddress: %v, enableEIP2718:%v, enableEIP1559:%v}",
|
if s.MaxTxPerBlock != nil {
|
||||||
s.UseZktrie, s.FeeVaultAddress, s.EnableEIP2718, s.EnableEIP1559)
|
maxTxPerBlock = fmt.Sprintf("%v", *s.MaxTxPerBlock)
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("{useZktrie: %v, maxTxPerBlock: %v, feeVaultAddress: %v, enableEIP2718:%v, enableEIP1559:%v}",
|
maxTxPayloadBytesPerBlock := "<nil>"
|
||||||
s.UseZktrie, *s.MaxTxPerBlock, s.FeeVaultAddress, s.EnableEIP2718, s.EnableEIP1559)
|
if s.MaxTxPayloadBytesPerBlock != nil {
|
||||||
|
maxTxPayloadBytesPerBlock = fmt.Sprintf("%v", *s.MaxTxPayloadBytesPerBlock)
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("{useZktrie: %v, maxTxPerBlock: %v, MaxTxPayloadBytesPerBlock: %v, feeVaultAddress: %v, enableEIP2718:%v, enableEIP1559:%v}",
|
||||||
|
s.UseZktrie, maxTxPerBlock, maxTxPayloadBytesPerBlock, s.FeeVaultAddress, s.EnableEIP2718, s.EnableEIP1559)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsValidTxCount returns whether the given block's transaction count is below the limit.
|
// IsValidTxCount returns whether the given block's transaction count is below the limit.
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 3 // Major version component of the current release
|
VersionMajor = 3 // Major version component of the current release
|
||||||
VersionMinor = 1 // Minor version component of the current release
|
VersionMinor = 1 // Minor version component of the current release
|
||||||
VersionPatch = 11 // Patch version component of the current release
|
VersionPatch = 12 // Patch version component of the current release
|
||||||
VersionMeta = "alpha" // Version metadata to append to the version string
|
VersionMeta = "alpha" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue