Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit a23fc42

Browse files
Testing Reversion Speed on Dispute Concluded Against (#6880)
* First pass adding logs * fmt * Adjustments
1 parent 177092c commit a23fc42

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

node/core/chain-selection/src/tree.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,14 @@ fn apply_ancestor_reversions(
359359
// of unviability is only heavy on the first log.
360360
for revert_number in reversions {
361361
let maybe_block_entry = load_ancestor(backend, block_hash, block_number, revert_number)?;
362+
if let Some(block_entry) = &maybe_block_entry {
363+
gum::trace!(
364+
target: LOG_TARGET,
365+
?revert_number,
366+
revert_hash = ?block_entry.block_hash,
367+
"Block marked as reverted via scraped on-chain reversions"
368+
);
369+
}
362370
revert_single_block_entry_if_present(
363371
backend,
364372
maybe_block_entry,
@@ -380,6 +388,12 @@ pub(crate) fn apply_single_reversion(
380388
revert_hash: Hash,
381389
revert_number: BlockNumber,
382390
) -> Result<(), Error> {
391+
gum::trace!(
392+
target: LOG_TARGET,
393+
?revert_number,
394+
?revert_hash,
395+
"Block marked as reverted via ChainSelectionMessage::RevertBlocks"
396+
);
383397
let maybe_block_entry = backend.load_block_entry(&revert_hash)?;
384398
revert_single_block_entry_if_present(
385399
backend,

node/core/dispute-coordinator/src/initialized.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,15 @@ impl Initialized {
10341034
// will need to mark the candidate's relay parent as reverted.
10351035
if import_result.is_freshly_concluded_against() {
10361036
let blocks_including = self.scraper.get_blocks_including_candidate(&candidate_hash);
1037+
for (parent_block_number, parent_block_hash) in &blocks_including {
1038+
gum::trace!(
1039+
target: LOG_TARGET,
1040+
?candidate_hash,
1041+
?parent_block_number,
1042+
?parent_block_hash,
1043+
"Dispute has just concluded against the candidate hash noted. Its parent will be marked as reverted."
1044+
);
1045+
}
10371046
if blocks_including.len() > 0 {
10381047
ctx.send_message(ChainSelectionMessage::RevertBlocks(blocks_including)).await;
10391048
} else {

0 commit comments

Comments
 (0)