Skip to content

[sui system] stricter metadata validation, cleanup#25792

Merged
damirka merged 16 commits intomainfrom
ds/validator-metadat
Mar 13, 2026
Merged

[sui system] stricter metadata validation, cleanup#25792
damirka merged 16 commits intomainfrom
ds/validator-metadat

Conversation

@damirka
Copy link
Copy Markdown
Contributor

@damirka damirka commented Mar 11, 2026

Description

  • make metadata checks stricter
  • code reorganisation and cleanup
  • drastically improves testing of metadata

Test plan

  • massive tests

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: metadata hardening in Sui System
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@damirka damirka self-assigned this Mar 11, 2026
@damirka damirka requested a review from a team as a code owner March 11, 2026 09:36
@damirka damirka temporarily deployed to sui-typescript-aws-kms-test-env March 11, 2026 09:36 — with GitHub Actions Inactive
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Mar 13, 2026 11:36am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Mar 13, 2026 11:36am
sui-kiosk Ignored Ignored Preview Mar 13, 2026 11:36am

Request Review

let validator = self
self
.validators
.get_validator_mut_with_verified_cap(&verified_cap, false /* include_candidate */);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The old one was not including candidates here but I think now we do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is not very explicit, but it will fail on verify_cap call if validator is not active or pending.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be very explicit, you meant the transaction will fail on the previous line (line 431) where we check the cap belongs to an active or pending validator right? So a candidate won't even get to line 432.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@emmazzz precisely, see the selector on the verify_cap method, it will abort if not found.

Copy link
Copy Markdown
Contributor

@dariorussi dariorussi left a comment

Choose a reason for hiding this comment

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

thanks for doing this, let's put it in

Copy link
Copy Markdown
Contributor

@manolisliolios manolisliolios left a comment

Choose a reason for hiding this comment

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

Looks great! Logic is so much easier to follow

@damirka damirka requested a review from mystenmark as a code owner March 13, 2026 11:34
@damirka damirka temporarily deployed to sui-typescript-aws-kms-test-env March 13, 2026 11:34 — with GitHub Actions Inactive
@damirka damirka requested a review from emmazzz March 13, 2026 11:36
@damirka damirka merged commit 83a312c into main Mar 13, 2026
62 of 69 checks passed
@damirka damirka deleted the ds/validator-metadat branch March 13, 2026 11:59
damirka added a commit that referenced this pull request Mar 13, 2026
## Description 

- make metadata checks stricter
- code reorganisation and cleanup
- drastically improves testing of metadata

## Test plan 

- massive tests

---

## 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.

- [x] Protocol: metadata hardening in Sui System
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:
dariorussi pushed a commit that referenced this pull request Mar 13, 2026
## Description 

- cherry pick of #25792 

---

## 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.

- [x] Protocol: metadata hardening in Sui System
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:

## Description 

Describe the changes or additions included in this PR.

## 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.

- [x] Protocol: metadata hardening in Sui System
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:
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.

6 participants