Skip to content

refactor: replace tee launcher hash votes with generics#2930

Closed
kevindeforth wants to merge 5 commits into
kd/1573-mpc-contract-introduce-generic-voting-structfrom
kd/replace-tee-votes-with-generics
Closed

refactor: replace tee launcher hash votes with generics#2930
kevindeforth wants to merge 5 commits into
kd/1573-mpc-contract-introduce-generic-voting-structfrom
kd/replace-tee-votes-with-generics

Conversation

@kevindeforth
Copy link
Copy Markdown
Contributor

@kevindeforth kevindeforth commented Apr 16, 2026

This is a draft, to showcase how to use the abstract voting structs.
Follow-up to #2739

Currently failing due to:

  • exceeding contract size limit.
  • one new TODO, questioning the existing use of ParticipantId. To be addressed before merge.

@kevindeforth kevindeforth force-pushed the kd/replace-tee-votes-with-generics branch from c24b66a to 8123f07 Compare April 16, 2026 15:08
@kevindeforth kevindeforth changed the title refactor: replace tee votes with generics refactor: replace tee launcher hash votes with generics Apr 16, 2026
@kevindeforth kevindeforth force-pushed the kd/1573-mpc-contract-introduce-generic-voting-struct branch from 0efb84e to 6a579df Compare April 16, 2026 15:30
@kevindeforth kevindeforth force-pushed the kd/replace-tee-votes-with-generics branch from 8123f07 to e63ed93 Compare April 16, 2026 15:41
@kevindeforth
Copy link
Copy Markdown
Contributor Author

Looking at this, I think we can simplify a bit by getting rid of the ProposalRegistry and storing all votes with respect to the hash of the proposal (or, directly the proposal, in case it is small).

So, while currently we have:

VotesRegistry:

  • BTreeMap<Voter, ProposalId>
  • BTreeMap<ProposalId, VoterSet<Voter>>

ProposalRegistry:

  • BTreeMap<ProposalHash, ProposalId>
  • IterableMap<ProposalId, (ProposalHash, Proposal)>.

It would probably be enough to simply use:
VotesRegistry:

  • BTreeMap<Voter, ProposalHash>
  • BTreeMap<ProposalHash, VoterSet<Voter>>

If the proposal is small or already a hash (such as for some proposals of the TEE state), we can store the proposal directly:

  • BTreeMap<Voter, Proopsal>
  • BTreeMap<Proposal, VoterSet<Voter>>

@kevindeforth
Copy link
Copy Markdown
Contributor Author

closing this in favor of #2935

@kevindeforth kevindeforth deleted the kd/replace-tee-votes-with-generics branch April 20, 2026 09:01
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.

1 participant