Skip to content

feat: add pallet-consensus-engine to support AURA to BABE migration#1892

Open
LGLO wants to merge 4 commits into
mainfrom
feat-pallet-consensus-engine
Open

feat: add pallet-consensus-engine to support AURA to BABE migration#1892
LGLO wants to merge 4 commits into
mainfrom
feat-pallet-consensus-engine

Conversation

@LGLO

@LGLO LGLO commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Overview

State machine for AURA to BABE migration.
Issue: #1740

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • All commits are signed off (git commit -s) for the DCO
  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

@LGLO
LGLO requested a review from a team as a code owner July 16, 2026 13:24
@datadog-official

This comment has been minimized.

@LGLO
LGLO force-pushed the feat-pallet-consensus-engine branch from d2dddf5 to 8843e02 Compare July 17, 2026 06:57
Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>
@LGLO
LGLO force-pushed the feat-pallet-consensus-engine branch from 8843e02 to e9ba324 Compare July 17, 2026 11:54
Comment thread pallets/consensus-engine/src/lib.rs
Comment thread runtime/src/lib.rs
Comment thread pallets/consensus-engine/src/lib.rs Outdated
Comment on lines +235 to +241
fn current_slot_from_aura_digest() -> Option<Slot> {
frame_system::Pallet::<T>::digest().logs.iter().find_map(|log| {
log.as_pre_runtime().and_then(|(id, mut data)| {
(id == AURA_ENGINE_ID).then(|| Slot::decode(&mut data).ok()).flatten()
})
})
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this one I prefer to read pre-digest and not depend on pallets ordering in runtime.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it is not making it dependent on the ordering of pallets in runtime, actually the right source of truth in particular belongs to pallet_sidechain, which we should also adjust to be generic here

Comment thread pallets/consensus-engine/src/lib.rs Outdated
Comment thread pallets/consensus-engine/src/mock.rs Outdated
Comment thread pallets/consensus-engine/src/lib.rs
Comment thread pallets/consensus-engine/src/lib.rs Outdated
Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>
Comment thread runtime/src/lib.rs
Comment thread runtime/src/lib.rs
LGLO added 2 commits July 20, 2026 16:03
…tely when looking into pre-digest items

Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>
Signed-off-by: Lech Głowiak <lech.glowiak@shielded.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants