Skip to content

Conversation

@AmbientTea
Copy link
Contributor

@AmbientTea AmbientTea commented Nov 13, 2025

Description

Removes dependency on slots crates from pallet-sidechain-rpc (sidechain_getStatus) by:

  • Adding a new runtime api sp_sidechain::GetEpochDurationApi and computing current/next PC epoch using it instead of slots
  • Removing sidechain.slot from the response by default
  • Adding a feature flag legacy-compat which adds the ability to read epoch duration / slots per epoch using raw calls to SlotApi and re-adds the sidechain.slot field as optional

The backward compatibility aspect of this PR is probably not really needed here, but we'll need to do the same in other parts of the codebase that are more important (eg. committee selection IDP needs access to epoch duration data, which for old blocks will need to be computed based on slot configuration exposed viaSlotApi).

Checklist

  • Commit sequence broadly makes sense and commits have useful messages.
  • The size limit of 400 LOC isn't needlessly exceeded
  • The PR refers to a JIRA ticket (if one exists)
  • New tests are added if needed and existing tests are updated.
  • New code is documented and existing documentation is updated.
  • Relevant logging and metrics added
  • Any changes are noted in the changelog.md for affected crate
  • Self-reviewed the diff

@AmbientTea AmbientTea force-pushed the ETCM-12419-decouple-sidechain-rpc-from-slots branch 2 times, most recently from b123dfd to 4c98b39 Compare November 13, 2025 12:25
@AmbientTea AmbientTea marked this pull request as ready for review November 13, 2025 14:04
Copy link
Contributor

@kpinter-iohk kpinter-iohk left a comment

Choose a reason for hiding this comment

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

minor comment

@AmbientTea AmbientTea force-pushed the ETCM-12419-decouple-sidechain-rpc-from-slots branch from 4c98b39 to 83ea68c Compare November 14, 2025 13:22
@AmbientTea AmbientTea force-pushed the ETCM-12419-decouple-sidechain-rpc-from-slots branch from 117143f to e378b6b Compare November 14, 2025 13:26
@AmbientTea AmbientTea enabled auto-merge (squash) November 14, 2025 13:26
@AmbientTea AmbientTea merged commit 4771709 into master Nov 14, 2025
44 of 54 checks passed
@AmbientTea AmbientTea deleted the ETCM-12419-decouple-sidechain-rpc-from-slots branch November 14, 2025 17:35
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.

3 participants