Skip to content

Fix/1242 1244 timelock address invariants - #1379

Open
Kaybee973 wants to merge 7 commits into
JSE-ORG:mainfrom
Kaybee973:fix/1242-1244-timelock-address-invariants
Open

Kaybee973 wants to merge 7 commits into
JSE-ORG:mainfrom
Kaybee973:fix/1242-1244-timelock-address-invariants

Conversation

@Kaybee973

Copy link
Copy Markdown

Pull Request Checklist

Thank you for contributing! Please review the following checklist to ensure your PR is ready for review.

Summary

  • Provide a clear and concise description of the changes.
  • Link to any related issues using Fixes #issue or Related to #issue.

Testing

  • All new code is covered by unit tests where applicable.
  • Existing tests pass locally (cargo test).
  • Added tests for edge cases and error conditions.
  • Updated any integration tests if necessary.

Documentation

  • Updated README.md if changes affect users.
  • Updated docstrings/comments for new/modified functions.
  • Added examples or updated existing examples if applicable.

Code Quality

  • Follows the project's coding style and conventions.
  • No commented-out code or debug statements left in the codebase.
  • Variables and functions are named descriptively.
  • Code is properly formatted (cargo fmt).
  • No new clippy warnings (cargo clippy).

Breaking Changes

  • If this PR introduces breaking changes, describe them and provide migration steps.
  • Updated version in Cargo.toml if appropriate (following semver).

Additional Notes

  • Any other relevant information for reviewers.

Please ensure all checkboxes are checked before requesting a review.

Closes #1244
Closes #1242

Kaybee973 and others added 3 commits November 25, 2026 13:41
The previous commit on main defined payout_platform_fee twice in
helpers/payout.rs, so the escrow lib did not compile (E0428) and no test
suite could run. Drop the byte-identical second copy.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
queue_set_fee_collector and queue_set_treasury hashed whatever address
they were given into the timelock proposal, so a zero, contract, or admin
address could be queued and, once executed, route protocol fees to a
black hole or collapse the admin/collector role split.

Run the existing fee-collector/treasury invariant helpers on the queue
path and extend both helpers to reject env.current_contract_address()
with InvalidAddress. execute_set_* already call these helpers, so queue
time and execution time now enforce the same rules.

Adds regression tests in test_admin.rs covering zero, contract, and admin
targets for both queued updates, plus the shared execution-time helper.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
)

TimelockQueued, TimelockExecuted, and TimelockCancelled already stamp
EVENT_SCHEMA_VERSION, but nothing pinned that contract for indexers, and
the emitter doc comments advertised a third `operation as u32` topic that
is never published.

Align the doc comments with the two-symbol tuples that are actually
emitted, keep EVENTS.md in sync, and add a regression test that decodes
the emitted TimelockQueued/Executed/Cancelled payloads, asserts
schema_version == EVENT_SCHEMA_VERSION, checks the topic tuple shape, and
round-trips each payload through XDR.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Nov 25, 2026

Copy link
Copy Markdown

@Kaybee973 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Kaybee973 and others added 4 commits November 28, 2026 15:45
Remove the stale duplicate `dispute_state_machine` module and dead helpers,
fix the clippy/rustfmt drift, and resync the TypeScript error codes with
`errors.rs` so the check, bindings and error-code jobs agree.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Picks up the upstream CI repairs (duplicate payout helper, rustfmt, clippy)
so this branch builds on current main instead of the broken base commit.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Settlement accrues protocol fees in the contract for the collector to pull
instead of transferring them immediately, fees are snapshotted at escrow
creation, and an admin rotation invalidates queued timelock slots. Update the
affected unit and integration tests, the fallback-deadline fixtures, and the
regenerated Soroban snapshots so `make test` and `make test-all` pass again.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
The fee-accrual change adds storage writes to settlement, pushing several
operations past the 5% gas gate. Record the current measurements so the
regression check compares against the merged behaviour.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
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.

Ensure Event Schema Version Consistency Across Timelock Events Enforce Non-Zero Address Invariant for Fee Collector and Treasury Queued Updates

1 participant