feat: schedule process_subsidies call after initiate_epoch_change#3200
feat: schedule process_subsidies call after initiate_epoch_change#3200
Conversation
c9340dc to
a71f351
Compare
There was a problem hiding this comment.
Pull request overview
Schedules a best-effort process_subsidies call immediately after attempting initiate_epoch_change, so usage-independent subsidies for the just-finished epoch can be paid right after an epoch transition.
Changes:
- Add a post-epoch-change
process_subsidiescall inInitiateEpochChangeOperation::invoke, gated by whether the subsidies object is configured. - Add unit and E2E coverage to validate the post-epoch-change subsidy processing behavior.
- Expose
latest_subsidized_epoch()(test-utils only) to assert that usage-independent subsidies advanced.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/walrus-sui/src/types/move_structs.rs | Adds a test-only accessor for the latest subsidized epoch from the deserialized WalrusSubsidies object. |
| crates/walrus-service/src/node/epoch_change_driver.rs | Calls process_subsidies after the epoch-change initiation attempt and adds a unit test verifying the sequencing. |
| crates/walrus-e2e-tests/tests/test_client.rs | Adds an E2E test asserting latest_epoch advances after an epoch change due to the new post-epoch-change call. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
karlwuest
left a comment
There was a problem hiding this comment.
LGTM (after the comments are addressed)!
|
Warning: This PR touches the |
b54330d to
dcb5a79
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcb5a794dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d9547d8 to
c9781b3
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9781b3c14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c9781b3 to
e643ee1
Compare
karlwuest
left a comment
There was a problem hiding this comment.
Thanks for all the changes, LGTM!
e643ee1 to
e5134fe
Compare
Description
Call process_subsidies after initiate_epoch_change in InitiateEpochChangeOperation::invoke to distribute usage-independent subsidies right after epoch transition, since the new contract usage independent subsidies only pay for previous epoch's subsidy.
The call runs regardless of whether initiate_epoch_change succeeds (since another node may have already initiated it), and failure is best-effort (logged but does not block the epoch change result)
Test plan
How did you test the new or updated feature?
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that
a user might notice and any actions they must take to implement updates. (Add release notes after the colon for each item)