fix: add ProofInBlocks to chain config (#280)

This commit is contained in:
Guillaume Ballet 2023-09-25 12:02:03 +02:00
parent 9db5d5c357
commit 713db1bbbc
3 changed files with 4 additions and 4 deletions

View file

@ -398,7 +398,7 @@ func (beacon *Beacon) FinalizeAndAssemble(chain consensus.ChainHeaderReader, hea
k verkle.StateDiff k verkle.StateDiff
keys = state.Witness().Keys() keys = state.Witness().Keys()
) )
if chain.Config().IsPrague(header.Number, header.Time) && chain.Config().ProofInBlock { if chain.Config().IsPrague(header.Number, header.Time) && chain.Config().ProofInBlocks {
// Open the pre-tree to prove the pre-state against // Open the pre-tree to prove the pre-state against
parent := chain.GetHeaderByNumber(header.Number.Uint64() - 1) parent := chain.GetHeaderByNumber(header.Number.Uint64() - 1)
if parent == nil { if parent == nil {
@ -448,7 +448,7 @@ func (beacon *Beacon) FinalizeAndAssemble(chain consensus.ChainHeaderReader, hea
// Assemble and return the final block. // Assemble and return the final block.
block := types.NewBlockWithWithdrawals(header, txs, uncles, receipts, withdrawals, trie.NewStackTrie(nil)) block := types.NewBlockWithWithdrawals(header, txs, uncles, receipts, withdrawals, trie.NewStackTrie(nil))
if chain.Config().IsPrague(header.Number, header.Time) && chain.Config().ProofInBlock { if chain.Config().IsPrague(header.Number, header.Time) && chain.Config().ProofInBlocks {
block.SetVerkleProof(p, k) block.SetVerkleProof(p, k)
} }
return block, nil return block, nil

View file

@ -454,7 +454,7 @@ func TestProcessVerkle(t *testing.T) {
PragueTime: u64(0), PragueTime: u64(0),
TerminalTotalDifficulty: common.Big0, TerminalTotalDifficulty: common.Big0,
TerminalTotalDifficultyPassed: true, TerminalTotalDifficultyPassed: true,
ProofInBlock: true, ProofInBlocks: true,
} }
signer = types.LatestSigner(config) signer = types.LatestSigner(config)
testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")

View file

@ -301,7 +301,7 @@ type ChainConfig struct {
IsDevMode bool `json:"isDev,omitempty"` IsDevMode bool `json:"isDev,omitempty"`
// Proof in block // Proof in block
ProofInBlock bool `json:"proofInBlock,omitempty"` ProofInBlocks bool `json:"proofInBlocks,omitempty"`
} }
// EthashConfig is the consensus engine configs for proof-of-work based sealing. // EthashConfig is the consensus engine configs for proof-of-work based sealing.