mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix: sealed header should not be immutable borrowed (#6456)
This commit is contained in:
@ -259,7 +259,7 @@ impl Command {
|
||||
Arc::clone(&best_block),
|
||||
Bytes::default(),
|
||||
OptimismPayloadBuilderAttributes::try_new(
|
||||
best_block.hash,
|
||||
best_block.hash(),
|
||||
OptimismPayloadAttributes {
|
||||
payload_attributes: payload_attrs,
|
||||
transactions: None,
|
||||
@ -274,7 +274,7 @@ impl Command {
|
||||
let payload_config = PayloadConfig::new(
|
||||
Arc::clone(&best_block),
|
||||
Bytes::default(),
|
||||
EthPayloadBuilderAttributes::try_new(best_block.hash, payload_attrs)?,
|
||||
EthPayloadBuilderAttributes::try_new(best_block.hash(), payload_attrs)?,
|
||||
self.chain.clone(),
|
||||
);
|
||||
|
||||
|
||||
@ -189,7 +189,7 @@ impl Command {
|
||||
match get_single_header(&client, BlockHashOrNumber::Number(block)).await {
|
||||
Ok(tip_header) => {
|
||||
info!(target: "reth::cli", ?block, "Successfully fetched block");
|
||||
return Ok(tip_header.hash)
|
||||
return Ok(tip_header.hash())
|
||||
}
|
||||
Err(error) => {
|
||||
error!(target: "reth::cli", ?block, %error, "Failed to fetch the block. Retrying...");
|
||||
|
||||
@ -164,15 +164,15 @@ impl<DB> NodeState<DB> {
|
||||
);
|
||||
}
|
||||
BeaconConsensusEngineEvent::CanonicalBlockAdded(block) => {
|
||||
info!(number=block.number, hash=?block.hash, "Block added to canonical chain");
|
||||
info!(number=block.number, hash=?block.hash(), "Block added to canonical chain");
|
||||
}
|
||||
BeaconConsensusEngineEvent::CanonicalChainCommitted(head, elapsed) => {
|
||||
self.latest_block = Some(head.number);
|
||||
|
||||
info!(number=head.number, hash=?head.hash, ?elapsed, "Canonical chain committed");
|
||||
info!(number=head.number, hash=?head.hash(), ?elapsed, "Canonical chain committed");
|
||||
}
|
||||
BeaconConsensusEngineEvent::ForkBlockAdded(block) => {
|
||||
info!(number=block.number, hash=?block.hash, "Block added to fork chain");
|
||||
info!(number=block.number, hash=?block.hash(), "Block added to fork chain");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,13 +210,13 @@ pub fn insert_genesis_header<DB: Database>(
|
||||
tx: &<DB as Database>::TXMut,
|
||||
chain: Arc<ChainSpec>,
|
||||
) -> ProviderResult<()> {
|
||||
let header = chain.sealed_genesis_header();
|
||||
let (header, block_hash) = chain.sealed_genesis_header().split();
|
||||
|
||||
tx.put::<tables::CanonicalHeaders>(0, header.hash)?;
|
||||
tx.put::<tables::HeaderNumbers>(header.hash, 0)?;
|
||||
tx.put::<tables::CanonicalHeaders>(0, block_hash)?;
|
||||
tx.put::<tables::HeaderNumbers>(block_hash, 0)?;
|
||||
tx.put::<tables::BlockBodyIndices>(0, Default::default())?;
|
||||
tx.put::<tables::HeaderTD>(0, header.difficulty.into())?;
|
||||
tx.put::<tables::Headers>(0, header.header)?;
|
||||
tx.put::<tables::Headers>(0, header)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user