Skip to content

Comments

fix: preserve order in message containers#533

Merged
mergify[bot] merged 3 commits intosigp:release-v0.3.0from
Zacholme7:msg-container-preserve-order
Aug 27, 2025
Merged

fix: preserve order in message containers#533
mergify[bot] merged 3 commits intosigp:release-v0.3.0from
Zacholme7:msg-container-preserve-order

Conversation

@Zacholme7
Copy link
Member

Issue Addressed

Messages must be stored in the order that they arrive in. This is important for the resulting signatures as even if we have the same messages, if they are not in the expected order this results in different encodings and signatures.

go-ssv just does this through a slice

@diegomrsantos
Copy link
Member

@Zacholme7 is this still a draft?

@Zacholme7
Copy link
Member Author

Whoops, its good to go

@Zacholme7 Zacholme7 marked this pull request as ready for review August 26, 2025 17:39
@Zacholme7 Zacholme7 added ready-for-review This PR is ready to be reviewed QBFT labels Aug 26, 2025
@diegomrsantos diegomrsantos requested a review from Copilot August 26, 2025 18:18

This comment was marked as outdated.

@Zacholme7 Zacholme7 changed the base branch from unstable to release-v0.3.0 August 27, 2025 01:32
@Zacholme7 Zacholme7 force-pushed the msg-container-preserve-order branch from e76507c to 4b05e19 Compare August 27, 2025 01:39
@dknopik dknopik added waiting-on-author and removed ready-for-review This PR is ready to be reviewed labels Aug 27, 2025
@Zacholme7 Zacholme7 added v0.3.0 Third and final testnet-only release and removed waiting-on-author v0.3.0 Third and final testnet-only release labels Aug 27, 2025
@diegomrsantos diegomrsantos requested a review from Copilot August 27, 2025 13:04
Copy link
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

This PR changes the internal storage structure of the MessageContainer to preserve message insertion order, which is critical for consistent signature generation. The change replaces a nested HashMap structure with a Vec-based approach while maintaining duplicate prevention through a separate tracking mechanism.

  • Replaces nested HashMap with Vec storage to maintain insertion order
  • Adds separate HashSet tracking to prevent duplicate messages from the same sender
  • Updates iteration logic throughout the codebase to work with the new Vec-based storage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@diegomrsantos
Copy link
Member

@dknopik do you want to give it a final review?

Copy link
Member

@dknopik dknopik left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit cec3648 into sigp:release-v0.3.0 Aug 27, 2025
15 checks passed
diegomrsantos pushed a commit to diegomrsantos/anchor that referenced this pull request Sep 17, 2025
Messages must be stored in the order that they arrive in. This is important for the resulting signatures as even if we have the same messages, if they are not in the expected order this results in different encodings and signatures.

go-ssv just does this through a [slice](https://github.com/ssvlabs/ssv-spec/blob/d4c734909677b5fd3304e1d9220963cc9d794f09/qbft/message_container.go#L9)
jking-aus pushed a commit to jking-aus/anchor that referenced this pull request Oct 8, 2025
Messages must be stored in the order that they arrive in. This is important for the resulting signatures as even if we have the same messages, if they are not in the expected order this results in different encodings and signatures.

go-ssv just does this through a [slice](https://github.com/ssvlabs/ssv-spec/blob/d4c734909677b5fd3304e1d9220963cc9d794f09/qbft/message_container.go#L9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants