|
|
@ -57,7 +57,6 @@ const ( |
|
|
|
//
|
|
|
|
//
|
|
|
|
// StateProcessor implements Processor.
|
|
|
|
// StateProcessor implements Processor.
|
|
|
|
type StateProcessor struct { |
|
|
|
type StateProcessor struct { |
|
|
|
config *params.ChainConfig // Chain configuration options
|
|
|
|
|
|
|
|
bc BlockChain // Canonical blockchain
|
|
|
|
bc BlockChain // Canonical blockchain
|
|
|
|
beacon BlockChain // Beacon chain
|
|
|
|
beacon BlockChain // Beacon chain
|
|
|
|
resultCache *lru.Cache // Cache for result after a certain block is processed
|
|
|
|
resultCache *lru.Cache // Cache for result after a certain block is processed
|
|
|
@ -135,9 +134,7 @@ func (p *StateProcessor) Process( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
processTxsAndStxs := true |
|
|
|
processTxsAndStxs := true |
|
|
|
cxReceipt, err := MayBalanceMigration( |
|
|
|
cxReceipt, err := MayBalanceMigration(gp, header, statedb, p.bc) |
|
|
|
gp, header, statedb, p.bc, p.config, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if errors.Is(err, ErrNoMigrationPossible) { |
|
|
|
if errors.Is(err, ErrNoMigrationPossible) { |
|
|
|
// ran out of accounts
|
|
|
|
// ran out of accounts
|
|
|
@ -534,8 +531,8 @@ func MayBalanceMigration( |
|
|
|
header *block.Header, |
|
|
|
header *block.Header, |
|
|
|
db *state.DB, |
|
|
|
db *state.DB, |
|
|
|
chain BlockChain, |
|
|
|
chain BlockChain, |
|
|
|
config *params.ChainConfig, |
|
|
|
|
|
|
|
) (*types.CXReceipt, error) { |
|
|
|
) (*types.CXReceipt, error) { |
|
|
|
|
|
|
|
config := chain.Config() |
|
|
|
isMainnet := nodeconfig.GetDefaultConfig().GetNetworkType() == nodeconfig.Mainnet |
|
|
|
isMainnet := nodeconfig.GetDefaultConfig().GetNetworkType() == nodeconfig.Mainnet |
|
|
|
if isMainnet { |
|
|
|
if isMainnet { |
|
|
|
if config.IsOneEpochBeforeHIP30(header.Epoch()) { |
|
|
|
if config.IsOneEpochBeforeHIP30(header.Epoch()) { |
|
|
|