Skip to content

Conversation

@Lynette7
Copy link

@Lynette7 Lynette7 commented Nov 7, 2025

Adds events to the paras pallet to enable external parties (like exchanges, indexers, and infrastructure providers) to monitor parachain runtime upgrades without constantly polling storage.

Closes #10074

Problem

Currently, when a parachain schedules a runtime upgrade, no event is emitted for external parties to listen to. This makes it difficult for exchanges and other infrastructure providers to:

  • Know when to expect transaction invalidations
  • Prepare their systems for parachain upgrades
  • Monitor the upgrade lifecycle

Changes

New Events Added:

  • CodeUpgradeScheduledAt(ParaId, BlockNumber) - Emitted when a code upgrade is scheduled
  • UpgradeGoAheadSignalSet(ParaId) - Emitted when the go-ahead signal is set
  • UpgradeRestrictionSignalSet(ParaId) - Emitted when upgrade restrictions are applied
  • UpgradeRestrictionSignalRemoved(ParaId) - Emitted when upgrade restrictions are removed
  • FutureCodeUpgradeRemoved(ParaId) - Emitted when a future upgrade is cancelled or applied

Event Emission Points:

  • proceed_with_upgrade() - Emits CodeUpgradeScheduledAt
  • process_scheduled_upgrade_changes() - Emits UpgradeGoAheadSignalSet
  • process_scheduled_upgrade_cooldowns() - Emits UpgradeRestrictionSignalRemoved
  • note_new_head() - Emits FutureCodeUpgradeRemoved
  • schedule_code_upgrade() - Emits UpgradeRestrictionSignalSet
  • enact_pvf_rejected() - Emits UpgradeGoAheadSignalSet and FutureCodeUpgradeRemoved

Testing

Added comprehensive tests covering:

  • Event emission for all upgrade strategies
  • Event emission during PVF rejection
  • Event emission for multiple parachains
  • Event emission throughout the upgrade lifecycle

Performance Impact

Events have minimal performance impact:

  • Only simple data (ParaId, BlockNumber) is emitted
  • No additional storage reads/writes beyond existing logic
  • Events are emitted in already-benchmarked code paths

Checklist

  • Added new events to track parachain upgrades
  • Added comprehensive tests for all new events
  • Events follow existing naming conventions

@cla-bot-2021
Copy link

cla-bot-2021 bot commented Nov 7, 2025

User @Lynette7, please sign the CLA here.

@Lynette7
Copy link
Author

@bkchr could I get feedback on this PR? Do you think the changes proposed here are valid and/or necessary? This is my first PR to the Polkadot SDK and I'm looking to learn so any feedback is highly appreciated.

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.

more events for paras pallet

1 participant