Skip to content

Commit

Permalink
Merge pull request #73 from mdehoog/time-based-forking
Browse files Browse the repository at this point in the history
Time based forking
  • Loading branch information
roberto-bayardo committed Dec 5, 2022
2 parents 01d1f49 + dac0e11 commit b2d6f07
Show file tree
Hide file tree
Showing 52 changed files with 168 additions and 131 deletions.
2 changes: 1 addition & 1 deletion accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
return fmt.Errorf("could not fetch parent")
}
// Check transaction validity
signer := types.MakeSigner(b.blockchain.Config(), block.Number())
signer := types.MakeSigner(b.blockchain.Config(), block.Number(), block.Time())
sender, err := types.Sender(signer, tx)
if err != nil {
return fmt.Errorf("invalid transaction: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
}
var (
statedb = MakePreState(rawdb.NewMemoryDatabase(), pre.Pre)
signer = types.MakeSigner(chainConfig, new(big.Int).SetUint64(pre.Env.Number))
signer = types.MakeSigner(chainConfig, new(big.Int).SetUint64(pre.Env.Number), pre.Env.Timestamp)
gaspool = new(core.GasPool)
blockHash = common.Hash{0x13, 0x37}
rejectedTxs []*rejectedTx
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func Transaction(ctx *cli.Context) error {
return NewError(ErrorIO, errors.New("only rlp supported"))
}
}
signer := types.MakeSigner(chainConfig, new(big.Int))
signer := types.MakeSigner(chainConfig, new(big.Int), 0)
// We now have the transactions in 'body', which is supposed to be an
// rlp list of transactions
it, err := rlp.NewListIterator([]byte(body))
Expand Down
2 changes: 1 addition & 1 deletion cmd/evm/internal/t8ntool/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func Transition(ctx *cli.Context) error {
}
}
// We may have to sign the transactions.
signer := types.MakeSigner(chainConfig, big.NewInt(int64(prestate.Env.Number)))
signer := types.MakeSigner(chainConfig, big.NewInt(int64(prestate.Env.Number)), prestate.Env.Timestamp)

if txs, err = signUnsignedTransactions(txsWithKeys, signer); err != nil {
return NewError(ErrorJson, fmt.Errorf("failed signing transactions: %v", err))
Expand Down
8 changes: 4 additions & 4 deletions consensus/beacon/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,15 @@ func (beacon *Beacon) verifyHeader(chain consensus.ChainHeaderReader, header, pa
return err
}
}
shanghai := chain.Config().IsShanghai(header.Number)
shanghai := chain.Config().IsShanghai(header.Time)
if shanghai && header.WithdrawalsHash == nil {
return fmt.Errorf("missing withdrawalsHash")
}
// Verify existence / non-existence of withdrawalsHash.
if !shanghai && header.WithdrawalsHash != nil {
return fmt.Errorf("invalid withdrawalsHash: have %s, expected nil", header.WithdrawalsHash)
}
if chain.Config().IsSharding(header.Number) {
if chain.Config().IsSharding(header.Time) {
// Verify the header's EIP-4844 attributes.
if err := misc.VerifyEip4844Header(chain.Config(), parent, header); err != nil {
return err
Expand Down Expand Up @@ -350,15 +350,15 @@ func (beacon *Beacon) Finalize(chain consensus.ChainHeaderReader, header *types.
return
}
// If withdrawals have been activated, process each one.
if chain.Config().IsShanghai(header.Number) {
if chain.Config().IsShanghai(header.Time) {
for _, w := range withdrawals {
state.AddBalance(w.Address, w.Amount)
}
}
// The block reward is no longer handled here. It's done by the
// external consensus engine.
header.Root = state.IntermediateRoot(true)
if chain.Config().IsSharding(header.Number) {
if chain.Config().IsSharding(header.Time) {
if parent := chain.GetHeaderByHash(header.ParentHash); parent != nil {
header.SetExcessDataGas(misc.CalcExcessDataGas(parent.ExcessDataGas, misc.CountBlobs(txs)))
} else {
Expand Down
4 changes: 2 additions & 2 deletions consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainHeaderReader, header
// Verify the header's EIP-1559 attributes.
return err
}
if !chain.Config().IsSharding(header.Number) {
if !chain.Config().IsSharding(header.Time) {
if header.ExcessDataGas != nil {
return fmt.Errorf("invalid excessDataGas before fork: have %v, want <nil>", header.ExcessDataGas)
}
Expand Down Expand Up @@ -576,7 +576,7 @@ func (c *Clique) Finalize(chain consensus.ChainHeaderReader, header *types.Heade
// No block rewards in PoA, so the state remains as is and uncles are dropped
header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number))
header.UncleHash = types.CalcUncleHash(nil)
if chain.Config().IsSharding(header.Number) {
if chain.Config().IsSharding(header.Time) {
if parent := chain.GetHeaderByHash(header.ParentHash); parent != nil {
header.SetExcessDataGas(misc.CalcExcessDataGas(parent.ExcessDataGas, misc.CountBlobs(txs)))
} else {
Expand Down
4 changes: 2 additions & 2 deletions consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
// Verify the header's EIP-1559 attributes.
return err
}
if !chain.Config().IsSharding(header.Number) {
if !chain.Config().IsSharding(header.Time) {
if header.ExcessDataGas != nil {
return fmt.Errorf("invalid excessDataGas before fork: have %v, expected 'nil'", header.ExcessDataGas)
}
Expand Down Expand Up @@ -609,7 +609,7 @@ func (ethash *Ethash) Finalize(chain consensus.ChainHeaderReader, header *types.
// Accumulate any block and uncle rewards and commit the final state root
accumulateRewards(chain.Config(), state, header, uncles)
header.Root = state.IntermediateRoot(chain.Config().IsEIP158(header.Number))
if chain.Config().IsSharding(header.Number) {
if chain.Config().IsSharding(header.Time) {
if parent := chain.GetHeaderByHash(header.ParentHash); parent != nil {
header.SetExcessDataGas(misc.CalcExcessDataGas(parent.ExcessDataGas, misc.CountBlobs(txs)))
} else {
Expand Down
4 changes: 2 additions & 2 deletions core/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func genValueTx(nbytes int) func(int, *BlockGen) {
toaddr := common.Address{}
data := make([]byte, nbytes)
gas, _ := IntrinsicGas(data, nil, false, false, false)
signer := types.MakeSigner(gen.config, big.NewInt(int64(i)))
signer := types.MakeSigner(gen.config, big.NewInt(int64(i)), 0)
gasPrice := big.NewInt(0)
if gen.header.BaseFee != nil {
gasPrice = gen.header.BaseFee
Expand Down Expand Up @@ -128,7 +128,7 @@ func genTxRing(naccounts int) func(int, *BlockGen) {
if gen.header.BaseFee != nil {
gasPrice = gen.header.BaseFee
}
signer := types.MakeSigner(gen.config, big.NewInt(int64(i)))
signer := types.MakeSigner(gen.config, big.NewInt(int64(i)), 0)
for {
gas -= params.TxGas
if gas < params.TxGas {
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals, setHead bool)
}

// Start a parallel signature recovery (signer will fluke on fork transition, minimal perf loss)
SenderCacher.RecoverFromBlocks(types.MakeSigner(bc.chainConfig, chain[0].Number()), chain)
SenderCacher.RecoverFromBlocks(types.MakeSigner(bc.chainConfig, chain[0].Number(), chain[0].Time()), chain)

var (
stats = insertStats{startTime: mclock.Now()}
Expand Down
7 changes: 4 additions & 3 deletions core/blockchain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4138,7 +4138,8 @@ func TestDataBlobTxs(t *testing.T) {
// Genesis (block 0): AllEthhashProtocolChanges
// Block 1 : ""
// Block 2 : Sharding
gspec.Config.ShardingForkBlock = common.Big2
var time uint64 = 2 * 10 // block time is 10 seconds, so this corresponds to second block.
gspec.Config.ShardingForkTime = &time
genesis := gspec.MustCommit(db)
signer := types.LatestSigner(gspec.Config)

Expand All @@ -4158,7 +4159,7 @@ func TestDataBlobTxs(t *testing.T) {
msg.GasFeeCap.SetFromBig(newGwei(5))
msg.GasTipCap.SetFromBig(big.NewInt(2))
msg.MaxFeePerDataGas.SetFromBig(big.NewInt(params.MinDataGasPrice))
// TODO: Add test case for max data fee too low
// TODO(eip-4844): Add test case for max data fee too low
msg.BlobVersionedHashes = []common.Hash{one, two}
txdata := &types.SignedBlobTx{Message: msg}

Expand Down Expand Up @@ -4332,7 +4333,7 @@ func TestEIP3651(t *testing.T) {

gspec.Config.BerlinBlock = common.Big0
gspec.Config.LondonBlock = common.Big0
gspec.Config.ShanghaiBlock = common.Big0
gspec.Config.ShanghaiTime = new(uint64)
signer := types.LatestSigner(gspec.Config)

_, blocks, _ := GenerateChainWithGenesis(gspec, engine, 1, func(i int, b *BlockGen) {
Expand Down
6 changes: 5 additions & 1 deletion core/chain_makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ func (b *BlockGen) Number() *big.Int {
return new(big.Int).Set(b.header.Number)
}

func (b *BlockGen) Time() uint64 {
return b.header.Time
}

// BaseFee returns the EIP-1559 base fee of the block being generated.
func (b *BlockGen) BaseFee() *big.Int {
return new(big.Int).Set(b.header.BaseFee)
Expand Down Expand Up @@ -291,7 +295,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
}
if b.engine != nil {
// Finalize and seal the block
shanghai := config.IsShanghai(b.header.Number)
shanghai := config.IsShanghai(b.header.Time)
if shanghai && b.withdrawals == nil {
// need to make empty list to denote non-nil, but empty withdrawals to calc withdrawals hash
b.withdrawals = make([]*types.Withdrawal, 0)
Expand Down
2 changes: 1 addition & 1 deletion core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func (g *Genesis) ToBlock() *types.Block {
head.BaseFee = new(big.Int).SetUint64(params.InitialBaseFee)
}
}
if g.Config.IsSharding(common.Big0) {
if g.Config.IsSharding(0) {
head.SetExcessDataGas(g.ExcessDataGas)
}
}
Expand Down
7 changes: 6 additions & 1 deletion core/rawdb/accessors_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,12 @@ func ReadReceipts(db ethdb.Reader, hash common.Hash, number uint64, config *para
log.Error("Missing body but have receipt", "hash", hash, "number", number)
return nil
}
if err := receipts.DeriveFields(config, hash, number, body.Transactions); err != nil {
header := ReadHeader(db, hash, number) // fetch the header to get the block time
if header == nil {
log.Error("Failed to retrieve block header", "hash", hash, "number", number)
return nil
}
if err := receipts.DeriveFields(config, hash, number, header.Time, body.Transactions); err != nil {
log.Error("Failed to derive block receipts fields", "hash", hash, "number", number, "err", err)
return nil
}
Expand Down
13 changes: 10 additions & 3 deletions core/rawdb/accessors_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,20 @@ func TestBlockReceiptStorage(t *testing.T) {
receipt2.Bloom = types.CreateBloom(types.Receipts{receipt2})
receipts := []*types.Receipt{receipt1, receipt2}

header := types.Header{
Number: big.NewInt(0),
Time: 0,
Extra: []byte("test read receipts"),
}
hash := header.Hash()

// Check that no receipt entries are in a pristine database
hash := common.BytesToHash([]byte{0x03, 0x14})
if rs := ReadReceipts(db, hash, 0, params.TestChainConfig); len(rs) != 0 {
t.Fatalf("non existent receipts returned: %v", rs)
}
// Insert the body that corresponds to the receipts
// Insert the body & header that corresponds to the receipts
WriteBody(db, hash, 0, body)
WriteHeader(db, &header)

// Insert the receipt slice into the database and check presence
WriteReceipts(db, hash, 0, receipts)
Expand Down Expand Up @@ -751,7 +758,7 @@ func TestReadLogs(t *testing.T) {
}

// Fill in log fields so we can compare their rlp encoding
if err := types.Receipts(receipts).DeriveFields(params.TestChainConfig, hash, 0, body.Transactions); err != nil {
if err := types.Receipts(receipts).DeriveFields(params.TestChainConfig, hash, 0, 0, body.Transactions); err != nil {
t.Fatal(err)
}
for i, pr := range receipts {
Expand Down
2 changes: 1 addition & 1 deletion core/state_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (p *statePrefetcher) Prefetch(block *types.Block, excessDataGas *big.Int, s
gaspool = new(GasPool).AddGas(block.GasLimit()).AddDataGas(params.MaxDataGasPerBlock)
blockContext = NewEVMBlockContext(header, excessDataGas, p.bc, nil)
evm = vm.NewEVM(blockContext, vm.TxContext{}, statedb, p.config, cfg)
signer = types.MakeSigner(p.config, header.Number)
signer = types.MakeSigner(p.config, header.Number, header.Time)
)
// Iterate over and process the individual transactions
byzantium := p.config.IsByzantium(block.Number())
Expand Down
13 changes: 7 additions & 6 deletions core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (p *StateProcessor) Process(block *types.Block, excessDataGas *big.Int, sta
header = block.Header()
blockHash = block.Hash()
blockNumber = block.Number()
blockTime = block.Time()
allLogs []*types.Log
gp = new(GasPool).AddGas(block.GasLimit()).AddDataGas(params.MaxDataGasPerBlock)
)
Expand All @@ -74,20 +75,20 @@ func (p *StateProcessor) Process(block *types.Block, excessDataGas *big.Int, sta
vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, p.config, cfg)
// Iterate over and process the individual transactions
for i, tx := range block.Transactions() {
msg, err := tx.AsMessage(types.MakeSigner(p.config, header.Number), header.BaseFee)
msg, err := tx.AsMessage(types.MakeSigner(p.config, header.Number, header.Time), header.BaseFee)
if err != nil {
return nil, nil, 0, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
}
statedb.SetTxContext(tx.Hash(), i)
receipt, err := applyTransaction(msg, p.config, nil, gp, statedb, blockNumber, blockHash, tx, usedGas, vmenv)
receipt, err := applyTransaction(msg, p.config, nil, gp, statedb, blockNumber, blockTime, blockHash, tx, usedGas, vmenv)
if err != nil {
return nil, nil, 0, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
}
receipts = append(receipts, receipt)
allLogs = append(allLogs, receipt.Logs...)
}
// Fail if Shanghai not enabled and len(withdrawals) is non-zero.
if !p.config.IsShanghai(block.Number()) && len(block.Withdrawals()) != 0 {
if !p.config.IsShanghai(header.Time) && len(block.Withdrawals()) != 0 {
return nil, nil, 0, fmt.Errorf("non-nil withdrawal before shanghai")
}
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
Expand All @@ -96,7 +97,7 @@ func (p *StateProcessor) Process(block *types.Block, excessDataGas *big.Int, sta
return receipts, allLogs, *usedGas, nil
}

func applyTransaction(msg types.Message, config *params.ChainConfig, author *common.Address, gp *GasPool, statedb *state.StateDB, blockNumber *big.Int, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (*types.Receipt, error) {
func applyTransaction(msg types.Message, config *params.ChainConfig, author *common.Address, gp *GasPool, statedb *state.StateDB, blockNumber *big.Int, blockTime uint64, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (*types.Receipt, error) {
// Create a new context to be used in the EVM environment.
txContext := NewEVMTxContext(msg)
evm.Reset(txContext, statedb)
Expand Down Expand Up @@ -146,12 +147,12 @@ func applyTransaction(msg types.Message, config *params.ChainConfig, author *com
// for the transaction, gas used and an error if the transaction failed,
// indicating the block was invalid.
func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, header *types.Header, excessDataGas *big.Int, tx *types.Transaction, usedGas *uint64, cfg vm.Config) (*types.Receipt, error) {
msg, err := tx.AsMessage(types.MakeSigner(config, header.Number), header.BaseFee)
msg, err := tx.AsMessage(types.MakeSigner(config, header.Number, header.Time), header.BaseFee)
if err != nil {
return nil, err
}
// Create a new context to be used in the EVM environment
blockContext := NewEVMBlockContext(header, excessDataGas, bc, author)
vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, config, cfg)
return applyTransaction(msg, config, author, gp, statedb, header.Number, header.Hash(), tx, usedGas, vmenv)
return applyTransaction(msg, config, author, gp, statedb, header.Number, header.Time, header.Hash(), tx, usedGas, vmenv)
}
9 changes: 6 additions & 3 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ func (st *StateTransition) buyGas() error {
// compute data fee for eip-4844 data blobs if any
dgval := new(big.Int)
var dataGasUsed uint64
if st.evm.ChainConfig().IsSharding(st.evm.Context.BlockNumber) {
if st.evm.ChainConfig().IsSharding(st.evm.Context.Time.Uint64()) {
if st.evm.Context.ExcessDataGas == nil {
return fmt.Errorf("sharding is active but ExcessDataGas is nil. Time: %v", st.evm.Context.Time.Uint64())
}
dgu := st.dataGasUsed()
if !dgu.IsUint64() {
return fmt.Errorf("data gas usage overflow: address %v have %v", st.msg.From().Hex(), dgu)
Expand Down Expand Up @@ -281,7 +284,7 @@ func (st *StateTransition) preCheck() error {
}
}
usesDataGas := st.dataGasUsed().Sign() > 0
if usesDataGas && st.evm.ChainConfig().IsSharding(st.evm.Context.BlockNumber) {
if usesDataGas && st.evm.ChainConfig().IsSharding(st.evm.Context.Time.Uint64()) {
dataGasPrice := misc.GetDataGasPrice(st.evm.Context.ExcessDataGas)
if dataGasPrice.Cmp(st.msg.MaxFeePerDataGas()) > 0 {
return fmt.Errorf("%w: address %v, maxFeePerDataGas: %v dataGasPrice: %v, excessDataGas: %v",
Expand Down Expand Up @@ -330,7 +333,7 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
var (
msg = st.msg
sender = vm.AccountRef(msg.From())
rules = st.evm.ChainConfig().Rules(st.evm.Context.BlockNumber, st.evm.Context.Random != nil)
rules = st.evm.ChainConfig().Rules(st.evm.Context.BlockNumber, st.evm.Context.Time.Uint64(), st.evm.Context.Random != nil)
contractCreation = msg.To() == nil
)

Expand Down
2 changes: 1 addition & 1 deletion core/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -1406,7 +1406,7 @@ func (pool *TxPool) reset(oldHead, newHead *types.Header) {
pool.istanbul = pool.chainconfig.IsIstanbul(next)
pool.eip2718 = pool.chainconfig.IsBerlin(next)
pool.eip1559 = pool.chainconfig.IsLondon(next)
pool.eip4844 = pool.chainconfig.IsSharding(next)
pool.eip4844 = pool.chainconfig.IsSharding(uint64(time.Now().Unix()))
}

// promoteExecutables moves transactions that have become processable from the
Expand Down
4 changes: 2 additions & 2 deletions core/types/receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) {

// DeriveFields fills the receipts with their computed fields based on consensus
// data and contextual infos like containing block and transactions.
func (rs Receipts) DeriveFields(config *params.ChainConfig, hash common.Hash, number uint64, txs Transactions) error {
signer := MakeSigner(config, new(big.Int).SetUint64(number))
func (rs Receipts) DeriveFields(config *params.ChainConfig, hash common.Hash, number uint64, time uint64, txs Transactions) error {
signer := MakeSigner(config, new(big.Int).SetUint64(number), time)

logIndex := uint(0)
if len(txs) != len(rs) {
Expand Down
5 changes: 3 additions & 2 deletions core/types/receipt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,15 @@ func TestDeriveFields(t *testing.T) {
}
// Clear all the computed fields and re-derive them
number := big.NewInt(1)
var time uint64
hash := common.BytesToHash([]byte{0x03, 0x14})

clearComputedFieldsOnReceipts(t, receipts)
if err := receipts.DeriveFields(params.TestChainConfig, hash, number.Uint64(), txs); err != nil {
if err := receipts.DeriveFields(params.TestChainConfig, hash, number.Uint64(), time, txs); err != nil {
t.Fatalf("DeriveFields(...) = %v, want <nil>", err)
}
// Iterate over all the computed fields and check that they're correct
signer := MakeSigner(params.TestChainConfig, number)
signer := MakeSigner(params.TestChainConfig, number, 0)

logIndex := uint(0)
for i := range receipts {
Expand Down
8 changes: 4 additions & 4 deletions core/types/transaction_signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ type sigCache struct {
from common.Address
}

// MakeSigner returns a Signer based on the given chain config and block number.
func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
// MakeSigner returns a Signer based on the given chain config, block number and time.
func MakeSigner(config *params.ChainConfig, blockNumber *big.Int, time uint64) Signer {
var signer Signer
switch {
case config.IsSharding(blockNumber):
case config.IsSharding(time):
signer = NewDankSigner(config.ChainID)
case config.IsLondon(blockNumber):
signer = NewLondonSigner(config.ChainID)
Expand All @@ -65,7 +65,7 @@ func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
// have the current block number available, use MakeSigner instead.
func LatestSigner(config *params.ChainConfig) Signer {
if config.ChainID != nil {
if config.ShardingForkBlock != nil {
if config.ShardingForkTime != nil {
return NewDankSigner(config.ChainID)
}
if config.LondonBlock != nil {
Expand Down
Loading

0 comments on commit b2d6f07

Please sign in to comment.