Skip to content

Refactor gov/proposals/v0 namespace to include the proposals order#299

Merged
joaosreis merged 2 commits into
mainfrom
joaosreis/refactor-gov-proposals-order
May 14, 2026
Merged

Refactor gov/proposals/v0 namespace to include the proposals order#299
joaosreis merged 2 commits into
mainfrom
joaosreis/refactor-gov-proposals-order

Conversation

@joaosreis
Copy link
Copy Markdown
Member

The order in which proposals were added must be preserved to properly reconstruct the ledger state.
This PR refactors the gov/proposals/v0 canonical namespace definition to also encode the order of each proposal.

@joaosreis joaosreis force-pushed the joaosreis/refactor-gov-proposals-order branch from 4d68c61 to e54d0b3 Compare May 14, 2026 08:40
@joaosreis joaosreis marked this pull request as ready for review May 14, 2026 08:40
@joaosreis joaosreis requested review from Copilot and qnikst May 14, 2026 08:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the gov/proposals/v0 namespace CDDL so proposal entries can encode insertion order, enabling deterministic reconstruction of ledger state from stored proposals.

Changes:

  • Update gov/proposals/v0 record_entry value shape to include an ordering word64 alongside the proposal payload.
  • Clarify the gov/proposals/v0 key-size comment (28-byte tx hash + 4-byte tx index + 2-byte proposal index).
  • Bump the pinned tweag/CIPs revision across Nix flake inputs, lockfile, and CI checkout to match the updated reference specs.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scls-cardano/cddl-src/Cardano/SCLS/Namespace/GovProposals.hs Encodes proposal insertion order in the namespace entry value.
scls-cardano/cddl-src/Cardano/SCLS/CDDL.hs Updates the key-size comment for gov/proposals/v0 to match the 28/4/2 breakdown.
flake.nix Updates the pinned tweag/CIPs revision used for reference specs.
flake.lock Locks the updated tweag/CIPs revision and narHash.
.github/workflows/haskell-ci.yml Updates CI to checkout the same pinned tweag/CIPs revision.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

|
|]
$ "record_entry" =:= proposal
$ "record_entry" =:= arr [a word64, a proposal]
@joaosreis joaosreis merged commit d9944d3 into main May 14, 2026
30 checks passed
@joaosreis joaosreis deleted the joaosreis/refactor-gov-proposals-order branch May 14, 2026 10:43
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