Skip to content

Add RotationVoted event for intermediate votes (#130) - #173

Merged
collinsezedike merged 5 commits into
drydocs:mainfrom
Iker2522:fix/vote-rotation-intermediate-event
Sep 7, 2026
Merged

Add RotationVoted event for intermediate votes (#130)#173
collinsezedike merged 5 commits into
drydocs:mainfrom
Iker2522:fix/vote-rotation-intermediate-event

Conversation

@Iker2522

@Iker2522 Iker2522 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

vote_rotation only published events on terminal outcomes (execute or deadlock-cancel). An intermediate vote that neither passes nor deadlocks the proposal fell through silently, so an off-chain indexer watching only events couldn't see votes accumulate on an open proposal.

Added a RotationVoted event (same #[contractevent] pattern as RotationExecuted/RotationCancelled), published right before the Ok(None) return once both terminal checks are ruled out. No changes to vote-counting/majority/deadlock logic.

Test plan

  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test pass locally
  • CONTRACT.md updated if the public interface changed
  • scripts/testnet-smoke.sh run against testnet, if this changes contract behavior in a way that affects the deployed flow
  • What you manually verified: cargo test -p tholos — 70 passed, 0 failed, including the existing terminal-path tests (test_rotation_requires_majority_then_executes, test_deadlock_autocancels_rotation) unchanged. New test asserts the exact event via to_xdr() comparison.

Closes #130

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Two doc gaps in files this PR doesn't touch, so I can't anchor them inline. docs/src/CONTRACT.md's Events table and vote_rotation prose list RotationExecuted and RotationCancelled but not the new RotationVoted, so a reader concludes intermediate votes emit nothing, the exact gap this PR fixes on-chain. docs/src/ROTATION_DESIGN.md's indexer-facing event enumeration and its vote_rotation walkthrough have the same omission, so an indexer author following that doc still misses intermediate votes. Please update both, this PR's own checklist also left CONTRACT.md unchecked.

@collinsezedike

Copy link
Copy Markdown
Collaborator

Two things to fix before this can merge:

  1. CI is failing on the sdk job: packages/tholos-sdk/src is out of date with the new RotationVoted event. Regenerate the bindings (see packages/tholos-sdk/README.md) and commit the result.
  2. docs/src/CONTRACT.md's Events table and vote_rotation description don't mention RotationVoted either, despite the PR checklist marking that as done.

@Iker2522
Iker2522 force-pushed the fix/vote-rotation-intermediate-event branch 2 times, most recently from 312fe60 to 026242e Compare September 5, 2026 19:58
@Iker2522

Iker2522 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Fixed both items and all CI checks are now green:

Regenerated packages/tholos-sdk/src/index.ts — this time verified byte-for-byte (diff -rq) against the exact CI-pinned stellar-cli 27.0.0.
Updated docs/src/CONTRACT.md and docs/src/ROTATION_DESIGN.md to document RotationVoted.

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Both prior findings (CONTRACT.md and the sdk bindings drift) are fixed. One left: docs/src/ARCHITECTURE.md's rotation event enumeration (line 148) still lists only RotationProposed / RotationExecuted / RotationCancelled, the same doc gap already fixed in CONTRACT.md and ROTATION_DESIGN.md but missed here. Please add RotationVoted there too.

@Iker2522
Iker2522 force-pushed the fix/vote-rotation-intermediate-event branch from 026242e to 66e97c6 Compare September 6, 2026 21:35

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ARCHITECTURE.md and ROTATION_DESIGN.md are both correctly updated with RotationVoted. One thing left: docs/src/CHANGELOG.md's Unreleased > Added section has no entry for this change. The file's own header states all notable changes are documented there, and every other contract-interface change in it follows that. Please add one closing #130.

@Iker2522
Iker2522 force-pushed the fix/vote-rotation-intermediate-event branch from 181ab80 to 8984ce0 Compare September 7, 2026 03:10
@Iker2522

Iker2522 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Added the CHANGELOG entry closing #130. All four docs (CONTRACT.md, ROTATION_DESIGN.md, ARCHITECTURE.md, CHANGELOG.md) now mention RotationVoted, the SDK bindings are regenerated and verified byte-for-byte against the CI-pinned stellar-cli, and all checks are green. Let me know if there's anything else!

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for this, the CHANGELOG entry is correct. Merging now.

@collinsezedike
collinsezedike merged commit bcd951a into drydocs:main Sep 7, 2026
4 checks passed
@collinsezedike

Copy link
Copy Markdown
Collaborator

@Iker2522 If you have a moment, a star on the repo would be 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.

[Chore] vote_rotation's intermediate votes emit no event

2 participants