mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 01:27:38 +00:00
Sokol v0: support for first epoch-set transition (#2411)
This commit is contained in:
parent
33b122424c
commit
d2552196ad
@ -15,6 +15,7 @@ linters:
|
|||||||
- unused
|
- unused
|
||||||
- varcheck
|
- varcheck
|
||||||
- gocritic
|
- gocritic
|
||||||
|
# - forcetypeassert
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
gocritic:
|
gocritic:
|
||||||
|
@ -2257,7 +2257,7 @@ func runBlock(ibs *state.IntraBlockState, txnWriter state.StateWriter, blockWrit
|
|||||||
|
|
||||||
if !vmConfig.ReadOnly {
|
if !vmConfig.ReadOnly {
|
||||||
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
||||||
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil); err != nil {
|
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil, nil, nil); err != nil {
|
||||||
return nil, fmt.Errorf("finalize of block %d failed: %v", block.NumberU64(), err)
|
return nil, fmt.Errorf("finalize of block %d failed: %v", block.NumberU64(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,6 +138,9 @@ func resetExec(tx ethdb.RwTx, g *core.Genesis) error {
|
|||||||
if err := tx.(ethdb.BucketMigrator).ClearBucket(dbutils.Epoch); err != nil {
|
if err := tx.(ethdb.BucketMigrator).ClearBucket(dbutils.Epoch); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if err := tx.(ethdb.BucketMigrator).ClearBucket(dbutils.PendingEpoch); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if err := stages.SaveStageProgress(tx, stages.Execution, 0); err != nil {
|
if err := stages.SaveStageProgress(tx, stages.Execution, 0); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -247,6 +250,7 @@ func printStages(db ethdb.KVGetter) error {
|
|||||||
defer w.Flush()
|
defer w.Flush()
|
||||||
w.Init(os.Stdout, 8, 8, 0, '\t', 0)
|
w.Init(os.Stdout, 8, 8, 0, '\t', 0)
|
||||||
fmt.Fprintf(w, "Note: prune_at doesn't mean 'all data before were deleted' - it just mean stage.Prune function were run to this block. Because 1 stage may prune multiple data types to different prune distance.\n")
|
fmt.Fprintf(w, "Note: prune_at doesn't mean 'all data before were deleted' - it just mean stage.Prune function were run to this block. Because 1 stage may prune multiple data types to different prune distance.\n")
|
||||||
|
fmt.Fprint(w, "\n \t stage_at \t prune_at\n")
|
||||||
for _, stage := range stages.AllStages {
|
for _, stage := range stages.AllStages {
|
||||||
if progress, err = stages.GetStageProgress(db, stage); err != nil {
|
if progress, err = stages.GetStageProgress(db, stage); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -255,13 +259,13 @@ func printStages(db ethdb.KVGetter) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fmt.Fprintf(w, "%s \t %d \t prune_at=%d\n", string(stage), progress, prunedTo)
|
fmt.Fprintf(w, "%s \t %d \t %d\n", string(stage), progress, prunedTo)
|
||||||
}
|
}
|
||||||
pm, err := prune.Get(db)
|
pm, err := prune.Get(db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fmt.Fprintf(w, "--\n")
|
fmt.Fprintf(w, "--\n")
|
||||||
fmt.Fprintf(w, "prune distance: %#v\n", pm)
|
fmt.Fprintf(w, "prune distance: %s\n\n", pm.ToString())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -156,6 +156,9 @@ func syncBySmallSteps(db ethdb.RwKV, miningConfig params.MiningConfig, ctx conte
|
|||||||
expectedAccountChanges := make(map[uint64]*changeset.ChangeSet)
|
expectedAccountChanges := make(map[uint64]*changeset.ChangeSet)
|
||||||
expectedStorageChanges := make(map[uint64]*changeset.ChangeSet)
|
expectedStorageChanges := make(map[uint64]*changeset.ChangeSet)
|
||||||
changeSetHook := func(blockNum uint64, csw *state.ChangeSetWriter) {
|
changeSetHook := func(blockNum uint64, csw *state.ChangeSetWriter) {
|
||||||
|
if csw == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
accountChanges, err := csw.GetAccountChanges()
|
accountChanges, err := csw.GetAccountChanges()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -120,7 +120,7 @@ func TestMatreshkaStream(t *testing.T) {
|
|||||||
|
|
||||||
checkTEVM := ethdb.GetCheckTEVM(tx)
|
checkTEVM := ethdb.GetCheckTEVM(tx)
|
||||||
|
|
||||||
_, err = core.ExecuteBlockEphemerally(chainConfig, &vm.Config{NoReceipts: true}, getHeader, ethash.NewFaker(), block, stateReaderWriter, stateReaderWriter, nil, checkTEVM)
|
_, err = core.ExecuteBlockEphemerally(chainConfig, &vm.Config{NoReceipts: true}, getHeader, ethash.NewFaker(), block, stateReaderWriter, stateReaderWriter, nil, nil, checkTEVM)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err, currentBlock)
|
t.Fatal(err, currentBlock)
|
||||||
}
|
}
|
||||||
|
@ -686,7 +686,7 @@ func runBlock(ibs *state.IntraBlockState, txnWriter state.StateWriter, blockWrit
|
|||||||
|
|
||||||
if !vmConfig.ReadOnly {
|
if !vmConfig.ReadOnly {
|
||||||
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
||||||
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil); err != nil {
|
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil, nil, nil); err != nil {
|
||||||
return nil, fmt.Errorf("finalize of block %d failed: %v", block.NumberU64(), err)
|
return nil, fmt.Errorf("finalize of block %d failed: %v", block.NumberU64(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,8 @@ const (
|
|||||||
Sequence = "Sequence" // tbl_name -> seq_u64
|
Sequence = "Sequence" // tbl_name -> seq_u64
|
||||||
HeadHeaderKey = "LastHeader"
|
HeadHeaderKey = "LastHeader"
|
||||||
|
|
||||||
Epoch = "DevEpoch" // block_num_u64+block_hash->transition_proof
|
Epoch = "DevEpoch" // block_num_u64+block_hash->transition_proof
|
||||||
|
PendingEpoch = "DevPendingEpoch" // block_num_u64+block_hash->transition_proof
|
||||||
)
|
)
|
||||||
|
|
||||||
// Keys
|
// Keys
|
||||||
@ -348,6 +349,7 @@ var Buckets = []string{
|
|||||||
HeadersBucket,
|
HeadersBucket,
|
||||||
HeaderTDBucket,
|
HeaderTDBucket,
|
||||||
Epoch,
|
Epoch,
|
||||||
|
PendingEpoch,
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeprecatedBuckets - list of buckets which can be programmatically deleted - for example after migration
|
// DeprecatedBuckets - list of buckets which can be programmatically deleted - for example after migration
|
||||||
|
@ -131,7 +131,7 @@ func (c *Collector) Close(logPrefix string) {
|
|||||||
totalSize += p.Dispose()
|
totalSize += p.Dispose()
|
||||||
}
|
}
|
||||||
if totalSize > 0 {
|
if totalSize > 0 {
|
||||||
log.Info(fmt.Sprintf("[%s] etl: temp files removed successfully", logPrefix), "total size", datasize.ByteSize(totalSize).HumanReadable())
|
log.Info(fmt.Sprintf("[%s] etl: temp files removed", logPrefix), "total size", datasize.ByteSize(totalSize).HumanReadable())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -24,15 +24,16 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon/common"
|
"github.com/ledgerwatch/erigon/common"
|
||||||
"github.com/ledgerwatch/erigon/common/hexutil"
|
"github.com/ledgerwatch/erigon/common/hexutil"
|
||||||
"github.com/ledgerwatch/erigon/common/u256"
|
"github.com/ledgerwatch/erigon/common/u256"
|
||||||
|
"github.com/ledgerwatch/erigon/consensus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Draws an validator nonce modulo number of validators.
|
// Draws an validator nonce modulo number of validators.
|
||||||
func GetFromValidatorSet(set ValidatorSet, parent common.Hash, nonce uint) (common.Address, error) {
|
func GetFromValidatorSet(set ValidatorSet, parent common.Hash, nonce uint, call consensus.Call) (common.Address, error) {
|
||||||
d, err := set.defaultCaller(parent)
|
//d, err := set.defaultCaller(parent)
|
||||||
if err != nil {
|
//if err != nil {
|
||||||
return common.Address{}, err
|
// return common.Address{}, err
|
||||||
}
|
//}
|
||||||
return set.getWithCaller(parent, nonce, d)
|
return set.getWithCaller(parent, nonce, call)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Different ways of specifying validators.
|
// Different ways of specifying validators.
|
||||||
@ -52,7 +53,7 @@ func newValidatorSetFromJson(j *ValidatorSetJson, posdaoTransition *uint64) Vali
|
|||||||
return &SimpleList{validators: j.List}
|
return &SimpleList{validators: j.List}
|
||||||
}
|
}
|
||||||
if j.SafeContract != nil {
|
if j.SafeContract != nil {
|
||||||
return &ValidatorSafeContract{contractAddress: *j.SafeContract, posdaoTransition: posdaoTransition}
|
return NewValidatorSafeContract(*j.SafeContract, posdaoTransition, nil)
|
||||||
}
|
}
|
||||||
if j.Contract != nil {
|
if j.Contract != nil {
|
||||||
return &ValidatorContract{
|
return &ValidatorContract{
|
||||||
|
72
consensus/aura/finality_test.go
Normal file
72
consensus/aura/finality_test.go
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
package aura
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/ledgerwatch/erigon/common"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestRollingFinality(t *testing.T) {
|
||||||
|
t.Run("RejectsUnknownSigners", func(t *testing.T) {
|
||||||
|
f := NewRollingFinality([]common.Address{{1}, {2}, {3}})
|
||||||
|
_, err := f.push(common.Hash{}, 0, []common.Address{{0}, {4}})
|
||||||
|
assert.Error(t, err)
|
||||||
|
_, err = f.push(common.Hash{}, 0, []common.Address{{0}, {1}, {4}})
|
||||||
|
assert.Error(t, err)
|
||||||
|
})
|
||||||
|
t.Run("FinalizeMultiple", func(t *testing.T) {
|
||||||
|
signers := []common.Address{{0}, {1}, {2}, {3}, {4}, {5}}
|
||||||
|
f := NewRollingFinality(signers)
|
||||||
|
// 3 / 6 signers is < 51% so no finality.
|
||||||
|
for i := 0; i < 6; i++ {
|
||||||
|
l, err := f.push(common.Hash{byte(i)}, uint64(i%3), []common.Address{signers[i%3]})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, 0, len(l))
|
||||||
|
}
|
||||||
|
// after pushing a block signed by a fourth validator, the first four
|
||||||
|
// blocks of the unverified chain become verified.
|
||||||
|
l, err := f.push(common.Hash{byte(6)}, 6, []common.Address{signers[4]})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
for i := uint64(0); i < 4; i++ {
|
||||||
|
assert.Equal(t, common.Hash{byte(i)}, l[i].hash)
|
||||||
|
}
|
||||||
|
assert.Equal(t, 4, len(l))
|
||||||
|
})
|
||||||
|
t.Run("FromAncestry", func(t *testing.T) {
|
||||||
|
signers := []common.Address{{0}, {1}, {2}, {3}, {4}, {5}}
|
||||||
|
f := NewRollingFinality(signers)
|
||||||
|
i := 12
|
||||||
|
get := func(hash common.Hash) ([]common.Address, common.Hash, common.Hash, uint64, bool) {
|
||||||
|
i--
|
||||||
|
if i == -1 {
|
||||||
|
return nil, common.Hash{}, common.Hash{}, 0, false
|
||||||
|
}
|
||||||
|
return []common.Address{signers[i%6]}, common.Hash{byte(i)}, common.Hash{byte(i - 1)}, uint64(i), true
|
||||||
|
}
|
||||||
|
err := f.buildAncestrySubChain(get, common.Hash{11}, common.Hash{99})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, 3, f.headers.l.Len())
|
||||||
|
assert.Equal(t, common.Hash{11}, *f.lastPushed)
|
||||||
|
})
|
||||||
|
t.Run("FromAncestryMultipleSigners", func(t *testing.T) {
|
||||||
|
signers := []common.Address{{0}, {1}, {2}, {3}, {4}, {5}}
|
||||||
|
f := NewRollingFinality(signers)
|
||||||
|
i := 12
|
||||||
|
get := func(hash common.Hash) ([]common.Address, common.Hash, common.Hash, uint64, bool) {
|
||||||
|
i--
|
||||||
|
if i == -1 {
|
||||||
|
return nil, common.Hash{}, common.Hash{}, 0, false
|
||||||
|
}
|
||||||
|
return []common.Address{signers[i%6], signers[(i+1)%6], signers[(i+2)%6]}, common.Hash{byte(i)}, common.Hash{byte(i - 1)}, uint64(i), true
|
||||||
|
}
|
||||||
|
err := f.buildAncestrySubChain(get, common.Hash{11}, common.Hash{99})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
// only the last hash has < 51% of authorities' signatures
|
||||||
|
assert.Equal(t, 1, f.headers.l.Len())
|
||||||
|
assert.Equal(t, common.Hash{11}, f.headers.Front().hash)
|
||||||
|
assert.Equal(t, common.Hash{11}, *f.lastPushed)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
@ -363,19 +363,23 @@ func (c *Clique) Prepare(chain consensus.ChainHeaderReader, header *types.Header
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Clique) Initialize(_ *params.ChainConfig, e consensus.EpochReader, header *types.Header, txs []types.Transaction, uncles []*types.Header, syscall consensus.SystemCall) {
|
func (c *Clique) Initialize(_ *params.ChainConfig, chain consensus.ChainHeaderReader, e consensus.EpochReader, header *types.Header, txs []types.Transaction, uncles []*types.Header,
|
||||||
|
syscall consensus.SystemCall, call consensus.Call) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finalize implements consensus.Engine, ensuring no uncles are set, nor block
|
// Finalize implements consensus.Engine, ensuring no uncles are set, nor block
|
||||||
// rewards given.
|
// rewards given.
|
||||||
func (c *Clique) Finalize(_ *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e consensus.EpochReader, syscall consensus.SystemCall) {
|
func (c *Clique) Finalize(_ *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts,
|
||||||
|
e consensus.EpochReader, chain consensus.ChainHeaderReader, syscall consensus.SystemCall, call consensus.Call) error {
|
||||||
// No block rewards in PoA, so the state remains as is and uncles are dropped
|
// No block rewards in PoA, so the state remains as is and uncles are dropped
|
||||||
header.UncleHash = types.CalcUncleHash(nil)
|
header.UncleHash = types.CalcUncleHash(nil)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// FinalizeAndAssemble implements consensus.Engine, ensuring no uncles are set,
|
// FinalizeAndAssemble implements consensus.Engine, ensuring no uncles are set,
|
||||||
// nor block rewards given, and returns the final block.
|
// nor block rewards given, and returns the final block.
|
||||||
func (c *Clique) FinalizeAndAssemble(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, receipts types.Receipts, e consensus.EpochReader, syscall consensus.SystemCall) (*types.Block, error) {
|
func (c *Clique) FinalizeAndAssemble(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, receipts types.Receipts,
|
||||||
|
e consensus.EpochReader, chain consensus.ChainHeaderReader, syscall consensus.SystemCall, call consensus.Call) (*types.Block, error) {
|
||||||
// No block rewards in PoA, so the state remains as is and uncles are dropped
|
// No block rewards in PoA, so the state remains as is and uncles are dropped
|
||||||
header.UncleHash = types.CalcUncleHash(nil)
|
header.UncleHash = types.CalcUncleHash(nil)
|
||||||
|
|
||||||
@ -467,7 +471,7 @@ func (c *Clique) Seal(chain consensus.ChainHeaderReader, block *types.Block, res
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Clique) GenerateSeal(chain consensus.ChainHeaderReader, currnt, parent *types.Header) []rlp.RawValue {
|
func (c *Clique) GenerateSeal(chain consensus.ChainHeaderReader, currnt, parent *types.Header, call consensus.Call) []rlp.RawValue {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,9 @@ type ChainReader interface {
|
|||||||
type EpochReader interface {
|
type EpochReader interface {
|
||||||
GetEpoch(blockHash common.Hash, blockN uint64) (transitionProof []byte, err error)
|
GetEpoch(blockHash common.Hash, blockN uint64) (transitionProof []byte, err error)
|
||||||
PutEpoch(blockHash common.Hash, blockN uint64, transitionProof []byte) (err error)
|
PutEpoch(blockHash common.Hash, blockN uint64, transitionProof []byte) (err error)
|
||||||
|
GetPendingEpoch(blockHash common.Hash, blockN uint64) (transitionProof []byte, err error)
|
||||||
|
PutPendingEpoch(blockHash common.Hash, blockN uint64, transitionProof []byte) (err error)
|
||||||
|
FindBeforeOrEqualNumber(number uint64) (blockNum uint64, blockHash common.Hash, transitionProof []byte, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type SystemCall func(contract common.Address, data []byte) ([]byte, error)
|
type SystemCall func(contract common.Address, data []byte) ([]byte, error)
|
||||||
@ -94,14 +97,14 @@ type Engine interface {
|
|||||||
Prepare(chain ChainHeaderReader, header *types.Header) error
|
Prepare(chain ChainHeaderReader, header *types.Header) error
|
||||||
|
|
||||||
// Initialize runs any pre-transaction state modifications (e.g. epoch start)
|
// Initialize runs any pre-transaction state modifications (e.g. epoch start)
|
||||||
Initialize(config *params.ChainConfig, e EpochReader, header *types.Header, txs []types.Transaction, uncles []*types.Header, syscall SystemCall)
|
Initialize(config *params.ChainConfig, chain ChainHeaderReader, e EpochReader, header *types.Header, txs []types.Transaction, uncles []*types.Header, syscall SystemCall, call Call)
|
||||||
|
|
||||||
// Finalize runs any post-transaction state modifications (e.g. block rewards)
|
// Finalize runs any post-transaction state modifications (e.g. block rewards)
|
||||||
// but does not assemble the block.
|
// but does not assemble the block.
|
||||||
//
|
//
|
||||||
// Note: The block header and state database might be updated to reflect any
|
// Note: The block header and state database might be updated to reflect any
|
||||||
// consensus rules that happen at finalization (e.g. block rewards).
|
// consensus rules that happen at finalization (e.g. block rewards).
|
||||||
Finalize(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e EpochReader, syscall SystemCall)
|
Finalize(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e EpochReader, chain ChainHeaderReader, syscall SystemCall, call Call) error
|
||||||
|
|
||||||
// FinalizeAndAssemble runs any post-transaction state modifications (e.g. block
|
// FinalizeAndAssemble runs any post-transaction state modifications (e.g. block
|
||||||
// rewards) and assembles the final block.
|
// rewards) and assembles the final block.
|
||||||
@ -109,7 +112,7 @@ type Engine interface {
|
|||||||
// Note: The block header and state database might be updated to reflect any
|
// Note: The block header and state database might be updated to reflect any
|
||||||
// consensus rules that happen at finalization (e.g. block rewards).
|
// consensus rules that happen at finalization (e.g. block rewards).
|
||||||
FinalizeAndAssemble(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction,
|
FinalizeAndAssemble(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction,
|
||||||
uncles []*types.Header, receipts types.Receipts, e EpochReader, syscall SystemCall) (*types.Block, error)
|
uncles []*types.Header, receipts types.Receipts, e EpochReader, chain ChainHeaderReader, syscall SystemCall, call Call) (*types.Block, error)
|
||||||
|
|
||||||
// Seal generates a new sealing request for the given input block and pushes
|
// Seal generates a new sealing request for the given input block and pushes
|
||||||
// the result into the given channel.
|
// the result into the given channel.
|
||||||
@ -125,7 +128,7 @@ type Engine interface {
|
|||||||
// that a new block should have.
|
// that a new block should have.
|
||||||
CalcDifficulty(chain ChainHeaderReader, time, parentTime uint64, parentDifficulty *big.Int, parentNumber uint64, parentHash, parentUncleHash common.Hash, parentSeal []rlp.RawValue) *big.Int
|
CalcDifficulty(chain ChainHeaderReader, time, parentTime uint64, parentDifficulty *big.Int, parentNumber uint64, parentHash, parentUncleHash common.Hash, parentSeal []rlp.RawValue) *big.Int
|
||||||
|
|
||||||
GenerateSeal(chain ChainHeaderReader, currnt, parent *types.Header) []rlp.RawValue
|
GenerateSeal(chain ChainHeaderReader, currnt, parent *types.Header, call Call) []rlp.RawValue
|
||||||
|
|
||||||
// VerifyFamily only used by Aura now - later may be merged into VerifyHeaders
|
// VerifyFamily only used by Aura now - later may be merged into VerifyHeaders
|
||||||
VerifyFamily(chain ChainHeaderReader, header *types.Header) error
|
VerifyFamily(chain ChainHeaderReader, header *types.Header) error
|
||||||
|
@ -328,7 +328,7 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ethash *Ethash) GenerateSeal(chain consensus.ChainHeaderReader, currnt, parent *types.Header) []rlp.RawValue {
|
func (ethash *Ethash) GenerateSeal(chain consensus.ChainHeaderReader, currnt, parent *types.Header, call consensus.Call) []rlp.RawValue {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -596,22 +596,26 @@ func (ethash *Ethash) Prepare(chain consensus.ChainHeaderReader, header *types.H
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ethash *Ethash) Initialize(config *params.ChainConfig, e consensus.EpochReader, header *types.Header, txs []types.Transaction, uncles []*types.Header, _ consensus.SystemCall) {
|
func (ethash *Ethash) Initialize(config *params.ChainConfig, chain consensus.ChainHeaderReader, e consensus.EpochReader, header *types.Header, txs []types.Transaction, uncles []*types.Header,
|
||||||
|
_ consensus.SystemCall, _ consensus.Call) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finalize implements consensus.Engine, accumulating the block and uncle rewards,
|
// Finalize implements consensus.Engine, accumulating the block and uncle rewards,
|
||||||
// setting the final state on the header
|
// setting the final state on the header
|
||||||
func (ethash *Ethash) Finalize(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e consensus.EpochReader, _ consensus.SystemCall) {
|
func (ethash *Ethash) Finalize(config *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts,
|
||||||
|
e consensus.EpochReader, chain consensus.ChainHeaderReader, _ consensus.SystemCall, call consensus.Call) error {
|
||||||
// Accumulate any block and uncle rewards and commit the final state root
|
// Accumulate any block and uncle rewards and commit the final state root
|
||||||
accumulateRewards(config, state, header, uncles)
|
accumulateRewards(config, state, header, uncles)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// FinalizeAndAssemble implements consensus.Engine, accumulating the block and
|
// FinalizeAndAssemble implements consensus.Engine, accumulating the block and
|
||||||
// uncle rewards, setting the final state and assembling the block.
|
// uncle rewards, setting the final state and assembling the block.
|
||||||
func (ethash *Ethash) FinalizeAndAssemble(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e consensus.EpochReader, syscall consensus.SystemCall) (*types.Block, error) {
|
func (ethash *Ethash) FinalizeAndAssemble(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts,
|
||||||
|
e consensus.EpochReader, chain consensus.ChainHeaderReader, syscall consensus.SystemCall, call consensus.Call) (*types.Block, error) {
|
||||||
|
|
||||||
// Finalize block
|
// Finalize block
|
||||||
ethash.Finalize(chainConfig, header, state, txs, uncles, r, e, syscall)
|
ethash.Finalize(chainConfig, header, state, txs, uncles, r, e, chain, syscall, call)
|
||||||
// Header seems complete, assemble into a block and return
|
// Header seems complete, assemble into a block and return
|
||||||
return types.NewBlock(header, txs, uncles, r), nil
|
return types.NewBlock(header, txs, uncles, r), nil
|
||||||
}
|
}
|
||||||
|
@ -96,6 +96,7 @@ func ExecuteBlockEphemerally(
|
|||||||
stateReader state.StateReader,
|
stateReader state.StateReader,
|
||||||
stateWriter state.WriterWithChangeSets,
|
stateWriter state.WriterWithChangeSets,
|
||||||
epochReader consensus.EpochReader,
|
epochReader consensus.EpochReader,
|
||||||
|
chainReader consensus.ChainHeaderReader,
|
||||||
checkTEVM func(codeHash common.Hash) (bool, error),
|
checkTEVM func(codeHash common.Hash) (bool, error),
|
||||||
) (types.Receipts, error) {
|
) (types.Receipts, error) {
|
||||||
defer blockExecutionTimer.UpdateSince(time.Now())
|
defer blockExecutionTimer.UpdateSince(time.Now())
|
||||||
@ -108,7 +109,7 @@ func ExecuteBlockEphemerally(
|
|||||||
gp.AddGas(block.GasLimit())
|
gp.AddGas(block.GasLimit())
|
||||||
|
|
||||||
if !vmConfig.ReadOnly {
|
if !vmConfig.ReadOnly {
|
||||||
if err := InitializeBlockExecution(engine, epochReader, block.Header(), block.Transactions(), block.Uncles(), chainConfig, ibs); err != nil {
|
if err := InitializeBlockExecution(engine, chainReader, epochReader, block.Header(), block.Transactions(), block.Uncles(), chainConfig, ibs); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,7 +168,7 @@ func ExecuteBlockEphemerally(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !vmConfig.ReadOnly {
|
if !vmConfig.ReadOnly {
|
||||||
if err := FinalizeBlockExecution(engine, block.Header(), block.Transactions(), block.Uncles(), stateWriter, chainConfig, ibs, receipts, epochReader); err != nil {
|
if err := FinalizeBlockExecution(engine, block.Header(), block.Transactions(), block.Uncles(), stateWriter, chainConfig, ibs, receipts, epochReader, chainReader); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,14 +265,19 @@ func CallContractTx(contract common.Address, data []byte, ibs *state.IntraBlockS
|
|||||||
|
|
||||||
func FinalizeBlockExecution(engine consensus.Engine, header *types.Header,
|
func FinalizeBlockExecution(engine consensus.Engine, header *types.Header,
|
||||||
txs types.Transactions, uncles []*types.Header, stateWriter state.WriterWithChangeSets, cc *params.ChainConfig,
|
txs types.Transactions, uncles []*types.Header, stateWriter state.WriterWithChangeSets, cc *params.ChainConfig,
|
||||||
ibs *state.IntraBlockState, receipts types.Receipts, e consensus.EpochReader,
|
ibs *state.IntraBlockState, receipts types.Receipts, e consensus.EpochReader, headerReader consensus.ChainHeaderReader,
|
||||||
) error {
|
) error {
|
||||||
//ibs.Print(cc.Rules(header.Number.Uint64()))
|
//ibs.Print(cc.Rules(header.Number.Uint64()))
|
||||||
//fmt.Printf("====tx processing end====\n")
|
//fmt.Printf("====tx processing end====\n")
|
||||||
|
|
||||||
engine.Finalize(cc, header, ibs, txs, uncles, receipts, e, func(contract common.Address, data []byte) ([]byte, error) {
|
if err := engine.Finalize(cc, header, ibs, txs, uncles, receipts, e, headerReader, func(contract common.Address, data []byte) ([]byte, error) {
|
||||||
|
return SysCallContract(contract, data, *cc, ibs, header, engine)
|
||||||
|
}, func(contract common.Address, data []byte) ([]byte, error) {
|
||||||
return CallContract(contract, data, *cc, ibs, header, engine)
|
return CallContract(contract, data, *cc, ibs, header, engine)
|
||||||
})
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
//fmt.Printf("====finalize start====\n")
|
//fmt.Printf("====finalize start====\n")
|
||||||
//ibs.Print(cc.Rules(header.Number.Uint64()))
|
//ibs.Print(cc.Rules(header.Number.Uint64()))
|
||||||
//fmt.Printf("====finalize end====\n")
|
//fmt.Printf("====finalize end====\n")
|
||||||
@ -293,10 +299,12 @@ func FinalizeBlockExecution(engine consensus.Engine, header *types.Header,
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func InitializeBlockExecution(engine consensus.Engine, epochReader consensus.EpochReader, header *types.Header, txs types.Transactions, uncles []*types.Header, cc *params.ChainConfig, ibs *state.IntraBlockState) error {
|
func InitializeBlockExecution(engine consensus.Engine, chain consensus.ChainHeaderReader, epochReader consensus.EpochReader, header *types.Header, txs types.Transactions, uncles []*types.Header, cc *params.ChainConfig, ibs *state.IntraBlockState) error {
|
||||||
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
||||||
engine.Initialize(cc, epochReader, header, txs, uncles, func(contract common.Address, data []byte) ([]byte, error) {
|
engine.Initialize(cc, chain, epochReader, header, txs, uncles, func(contract common.Address, data []byte) ([]byte, error) {
|
||||||
return SysCallContract(contract, data, *cc, ibs, header, engine)
|
return SysCallContract(contract, data, *cc, ibs, header, engine)
|
||||||
|
}, func(contract common.Address, data []byte) ([]byte, error) {
|
||||||
|
return CallContract(contract, data, *cc, ibs, header, engine)
|
||||||
})
|
})
|
||||||
//fmt.Printf("====InitializeBlockExecution start %d====\n", header.Number.Uint64())
|
//fmt.Printf("====InitializeBlockExecution start %d====\n", header.Number.Uint64())
|
||||||
//ibs.Print(cc.Rules(header.Number.Uint64()))
|
//ibs.Print(cc.Rules(header.Number.Uint64()))
|
||||||
|
@ -276,7 +276,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
|
|||||||
}
|
}
|
||||||
if b.engine != nil {
|
if b.engine != nil {
|
||||||
// Finalize and seal the block
|
// Finalize and seal the block
|
||||||
if _, err := b.engine.FinalizeAndAssemble(config, b.header, ibs, b.txs, b.uncles, b.receipts, nil, nil); err != nil {
|
if _, err := b.engine.FinalizeAndAssemble(config, b.header, ibs, b.txs, b.uncles, b.receipts, nil, nil, nil, nil); err != nil {
|
||||||
return nil, nil, fmt.Errorf("call to FinaliseAndAssemble: %w", err)
|
return nil, nil, fmt.Errorf("call to FinaliseAndAssemble: %w", err)
|
||||||
}
|
}
|
||||||
// Write state changes to db
|
// Write state changes to db
|
||||||
@ -408,7 +408,7 @@ func makeHeader(chain consensus.ChainReader, parent *types.Block, state *state.I
|
|||||||
Number: new(big.Int).Add(parent.Number(), common.Big1),
|
Number: new(big.Int).Add(parent.Number(), common.Big1),
|
||||||
Time: time,
|
Time: time,
|
||||||
}
|
}
|
||||||
header.Seal = engine.GenerateSeal(chain, header, parent.Header())
|
header.Seal = engine.GenerateSeal(chain, header, parent.Header(), nil)
|
||||||
|
|
||||||
if chain.Config().IsLondon(header.Number.Uint64()) {
|
if chain.Config().IsLondon(header.Number.Uint64()) {
|
||||||
header.BaseFee = misc.CalcBaseFee(chain.Config(), parent.Header())
|
header.BaseFee = misc.CalcBaseFee(chain.Config(), parent.Header())
|
||||||
|
@ -877,15 +877,56 @@ func ReadAncestor(db ethdb.KVGetter, hash common.Hash, number, ancestor uint64,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ReadEpoch(tx ethdb.Tx, blockNum uint64, blockHash common.Hash) (transitionProof []byte, err error) {
|
func ReadEpoch(tx ethdb.Tx, blockNum uint64, blockHash common.Hash) (transitionProof []byte, err error) {
|
||||||
k := make([]byte, 8+32)
|
k := make([]byte, dbutils.NumberLength+common.HashLength)
|
||||||
binary.BigEndian.PutUint64(k, blockNum)
|
binary.BigEndian.PutUint64(k, blockNum)
|
||||||
copy(k[8:], blockHash[:])
|
copy(k[dbutils.NumberLength:], blockHash[:])
|
||||||
return tx.GetOne(dbutils.Epoch, k)
|
return tx.GetOne(dbutils.Epoch, k)
|
||||||
}
|
}
|
||||||
|
func FindEpochBeforeOrEqualNumber(tx ethdb.Tx, n uint64) (blockNum uint64, blockHash common.Hash, transitionProof []byte, err error) {
|
||||||
|
c, err := tx.Cursor(dbutils.Epoch)
|
||||||
|
if err != nil {
|
||||||
|
return 0, common.Hash{}, nil, err
|
||||||
|
}
|
||||||
|
defer c.Close()
|
||||||
|
k := make([]byte, dbutils.NumberLength)
|
||||||
|
binary.BigEndian.PutUint64(k, n)
|
||||||
|
k, v, err := c.Seek(k)
|
||||||
|
if err != nil {
|
||||||
|
return 0, common.Hash{}, nil, err
|
||||||
|
}
|
||||||
|
if k != nil {
|
||||||
|
num := binary.BigEndian.Uint64(k)
|
||||||
|
if num == n {
|
||||||
|
return n, common.BytesToHash(k[dbutils.NumberLength:]), v, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
k, v, err = c.Prev()
|
||||||
|
if err != nil {
|
||||||
|
return 0, common.Hash{}, nil, err
|
||||||
|
}
|
||||||
|
if k == nil {
|
||||||
|
return 0, common.Hash{}, nil, nil
|
||||||
|
}
|
||||||
|
return binary.BigEndian.Uint64(k), common.BytesToHash(k[dbutils.NumberLength:]), v, nil
|
||||||
|
}
|
||||||
|
|
||||||
func WriteEpoch(tx ethdb.RwTx, blockNum uint64, blockHash common.Hash, transitionProof []byte) (err error) {
|
func WriteEpoch(tx ethdb.RwTx, blockNum uint64, blockHash common.Hash, transitionProof []byte) (err error) {
|
||||||
|
k := make([]byte, dbutils.NumberLength+common.HashLength)
|
||||||
|
binary.BigEndian.PutUint64(k, blockNum)
|
||||||
|
copy(k[dbutils.NumberLength:], blockHash[:])
|
||||||
|
return tx.Put(dbutils.Epoch, k, transitionProof)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ReadPendingEpoch(tx ethdb.Tx, blockNum uint64, blockHash common.Hash) (transitionProof []byte, err error) {
|
||||||
k := make([]byte, 8+32)
|
k := make([]byte, 8+32)
|
||||||
binary.BigEndian.PutUint64(k, blockNum)
|
binary.BigEndian.PutUint64(k, blockNum)
|
||||||
copy(k[8:], blockHash[:])
|
copy(k[8:], blockHash[:])
|
||||||
return tx.Put(dbutils.Epoch, k, transitionProof)
|
return tx.GetOne(dbutils.PendingEpoch, k)
|
||||||
|
}
|
||||||
|
|
||||||
|
func WritePendingEpoch(tx ethdb.RwTx, blockNum uint64, blockHash common.Hash, transitionProof []byte) (err error) {
|
||||||
|
k := make([]byte, 8+32)
|
||||||
|
binary.BigEndian.PutUint64(k, blockNum)
|
||||||
|
copy(k[8:], blockHash[:])
|
||||||
|
return tx.Put(dbutils.PendingEpoch, k, transitionProof)
|
||||||
}
|
}
|
||||||
|
@ -172,6 +172,7 @@ func promoteCallTraces(logPrefix string, tx ethdb.RwTx, startBlock, endBlock uin
|
|||||||
if err = flushBitmaps64(collectorTo, tos); err != nil {
|
if err = flushBitmaps64(collectorTo, tos); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up before loading call traces to reclaim space
|
// Clean up before loading call traces to reclaim space
|
||||||
var prunedMin uint64 = math.MaxUint64
|
var prunedMin uint64 = math.MaxUint64
|
||||||
var prunedMax uint64 = 0
|
var prunedMax uint64 = 0
|
||||||
|
@ -112,7 +112,7 @@ func executeBlock(
|
|||||||
callTracer := NewCallTracer(checkTEVM)
|
callTracer := NewCallTracer(checkTEVM)
|
||||||
vmConfig.Debug = true
|
vmConfig.Debug = true
|
||||||
vmConfig.Tracer = callTracer
|
vmConfig.Tracer = callTracer
|
||||||
receipts, err := core.ExecuteBlockEphemerally(cfg.chainConfig, &vmConfig, getHeader, cfg.engine, block, stateReader, stateWriter, epochReader{tx: tx}, checkTEVM)
|
receipts, err := core.ExecuteBlockEphemerally(cfg.chainConfig, &vmConfig, getHeader, cfg.engine, block, stateReader, stateWriter, epochReader{tx: tx}, chainReader{config: cfg.chainConfig, tx: tx}, checkTEVM)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -364,6 +364,15 @@ func (cr epochReader) GetEpoch(hash common.Hash, number uint64) ([]byte, error)
|
|||||||
func (cr epochReader) PutEpoch(hash common.Hash, number uint64, proof []byte) error {
|
func (cr epochReader) PutEpoch(hash common.Hash, number uint64, proof []byte) error {
|
||||||
return rawdb.WriteEpoch(cr.tx, number, hash, proof)
|
return rawdb.WriteEpoch(cr.tx, number, hash, proof)
|
||||||
}
|
}
|
||||||
|
func (cr epochReader) GetPendingEpoch(hash common.Hash, number uint64) ([]byte, error) {
|
||||||
|
return rawdb.ReadPendingEpoch(cr.tx, number, hash)
|
||||||
|
}
|
||||||
|
func (cr epochReader) PutPendingEpoch(hash common.Hash, number uint64, proof []byte) error {
|
||||||
|
return rawdb.WritePendingEpoch(cr.tx, number, hash, proof)
|
||||||
|
}
|
||||||
|
func (cr epochReader) FindBeforeOrEqualNumber(number uint64) (blockNum uint64, blockHash common.Hash, transitionProof []byte, err error) {
|
||||||
|
return rawdb.FindEpochBeforeOrEqualNumber(cr.tx, number)
|
||||||
|
}
|
||||||
|
|
||||||
func HeadersPrune(p *PruneState, tx ethdb.RwTx, cfg HeadersCfg, ctx context.Context) (err error) {
|
func HeadersPrune(p *PruneState, tx ethdb.RwTx, cfg HeadersCfg, ctx context.Context) (err error) {
|
||||||
useExternalTx := tx != nil
|
useExternalTx := tx != nil
|
||||||
|
@ -104,7 +104,7 @@ func SpawnMiningExecStage(s *StageState, tx ethdb.RwTx, cfg MiningExecCfg, quit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := core.FinalizeBlockExecution(cfg.engine, current.Header, current.Txs, current.Uncles, stateWriter, &cfg.chainConfig, ibs, nil, nil); err != nil {
|
if err := core.FinalizeBlockExecution(cfg.engine, current.Header, current.Txs, current.Uncles, stateWriter, &cfg.chainConfig, ibs, nil, nil, nil); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,8 +85,8 @@ func TxLookupTransform(logPrefix string, tx ethdb.RwTx, startKey, endKey []byte,
|
|||||||
return fmt.Errorf("%s: tx lookup generation, empty block body %d, hash %x", logPrefix, blocknum, v)
|
return fmt.Errorf("%s: tx lookup generation, empty block body %d, hash %x", logPrefix, blocknum, v)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tx := range body.Transactions {
|
for _, txn := range body.Transactions {
|
||||||
if err := next(k, tx.Hash().Bytes(), bigNum.SetUint64(blocknum).Bytes()); err != nil {
|
if err := next(k, txn.Hash().Bytes(), bigNum.SetUint64(blocknum).Bytes()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ func runBlock(ibs *state.IntraBlockState, txnWriter state.StateWriter, blockWrit
|
|||||||
|
|
||||||
if !vmConfig.ReadOnly {
|
if !vmConfig.ReadOnly {
|
||||||
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
||||||
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil); err != nil {
|
if _, err := engine.FinalizeAndAssemble(chainConfig, header, ibs, block.Transactions(), block.Uncles(), receipts, nil, nil, nil, nil); err != nil {
|
||||||
return nil, fmt.Errorf("finalize of block %d failed: %v", block.NumberU64(), err)
|
return nil, fmt.Errorf("finalize of block %d failed: %v", block.NumberU64(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,14 +46,18 @@ func (c *powEngine) VerifySeal(chain consensus.ChainHeaderReader, header *types.
|
|||||||
func (c *powEngine) Prepare(chain consensus.ChainHeaderReader, header *types.Header) error {
|
func (c *powEngine) Prepare(chain consensus.ChainHeaderReader, header *types.Header) error {
|
||||||
panic("must not be called")
|
panic("must not be called")
|
||||||
}
|
}
|
||||||
func (c *powEngine) Initialize(chainConfig *params.ChainConfig, e consensus.EpochReader, header *types.Header, txs []types.Transaction, uncles []*types.Header, syscall consensus.SystemCall) {
|
func (c *powEngine) Initialize(chainConfig *params.ChainConfig, chain consensus.ChainHeaderReader, e consensus.EpochReader, header *types.Header, txs []types.Transaction, uncles []*types.Header,
|
||||||
|
syscall consensus.SystemCall, call consensus.Call) {
|
||||||
panic("must not be called")
|
panic("must not be called")
|
||||||
}
|
}
|
||||||
func (c *powEngine) Finalize(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction, uncles []*types.Header, r types.Receipts, e consensus.EpochReader, syscall consensus.SystemCall) {
|
func (c *powEngine) Finalize(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState,
|
||||||
|
txs []types.Transaction, uncles []*types.Header, r types.Receipts,
|
||||||
|
e consensus.EpochReader, h consensus.ChainHeaderReader, syscall consensus.SystemCall, call consensus.Call) error {
|
||||||
panic("must not be called")
|
panic("must not be called")
|
||||||
}
|
}
|
||||||
func (c *powEngine) FinalizeAndAssemble(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState, txs []types.Transaction,
|
func (c *powEngine) FinalizeAndAssemble(chainConfig *params.ChainConfig, header *types.Header, state *state.IntraBlockState,
|
||||||
uncles []*types.Header, receipts types.Receipts, e consensus.EpochReader, syscall consensus.SystemCall) (*types.Block, error) {
|
txs []types.Transaction, uncles []*types.Header, receipts types.Receipts,
|
||||||
|
e consensus.EpochReader, h consensus.ChainHeaderReader, syscall consensus.SystemCall, call consensus.Call) (*types.Block, error) {
|
||||||
panic("must not be called")
|
panic("must not be called")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +68,7 @@ func (c *powEngine) SealHash(header *types.Header) common.Hash {
|
|||||||
panic("must not be called")
|
panic("must not be called")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *powEngine) GenerateSeal(chain consensus.ChainHeaderReader, currnt, parent *types.Header) []rlp.RawValue {
|
func (c *powEngine) GenerateSeal(chain consensus.ChainHeaderReader, currnt, parent *types.Header, call consensus.Call) []rlp.RawValue {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user