Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sui system] SIP-39 (reroll) #21303

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

[sui system] SIP-39 (reroll) #21303

wants to merge 4 commits into from

Conversation

damirka
Copy link
Contributor

@damirka damirka commented Feb 21, 2025

Description

Test plan

  • Features tests for new functions.

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.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@damirka damirka temporarily deployed to sui-typescript-aws-kms-test-env February 21, 2025 09:57 — with GitHub Actions Inactive
Copy link

vercel bot commented Feb 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2025 0:17am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 0:17am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Feb 21, 2025 0:17am

@damirka damirka temporarily deployed to sui-typescript-aws-kms-test-env February 21, 2025 10:05 — with GitHub Actions Inactive
@damirka damirka self-assigned this Feb 21, 2025
@damirka damirka requested a review from emmazzz February 21, 2025 10:07
@damirka damirka marked this pull request as ready for review February 21, 2025 10:07
@damirka damirka temporarily deployed to sui-typescript-aws-kms-test-env February 21, 2025 10:07 — with GitHub Actions Inactive
Copy link
Contributor

@tnowacki tnowacki left a comment

Choose a reason for hiding this comment

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

What is our test plan for this? I see new unit tests but do we have end to end test coverage?

@@ -139,3 +143,9 @@ public fun increment_epoch_number(self: &mut TxContext) {
public fun increment_epoch_timestamp(self: &mut TxContext, delta_ms: u64) {
self.epoch_timestamp_ms = self.epoch_timestamp_ms + delta_ms
}

#[test_only]
public fun set_epoch(self: &mut TxContext, epoch: u64) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we call this advance_epoch? since it can't go backwards

Copy link
Contributor

Choose a reason for hiding this comment

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

We have APIs that should help address this already in test_scenario. I would vote we continue to use those and not build out competing APIs

Comment on lines +266 to +272
if (epoch < start_epoch + phase_length) { // phase 1
(12, 8, 4)
} else if (epoch < start_epoch + (2 * phase_length)) { // phase 2
(6, 4, 2)
} else { // phase 3
(3, 2, 1)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, do we want {} on the if-else bodies here?

Comment on lines +421 to +423
if (!self.extra_fields.contains(key)) {
self.extra_fields.add(key, ctx.epoch());
};
Copy link
Contributor

Choose a reason for hiding this comment

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

consider

Suggested change
if (!self.extra_fields.contains(key)) {
self.extra_fields.add(key, ctx.epoch());
};
if (!self.extra_fields.contains(key)) self.extra_fields.add(key, ctx.epoch());

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.

2 participants