[sui system] stricter metadata validation, cleanup#25792
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| let validator = self | ||
| self | ||
| .validators | ||
| .get_validator_mut_with_verified_cap(&verified_cap, false /* include_candidate */); |
There was a problem hiding this comment.
The old one was not including candidates here but I think now we do?
There was a problem hiding this comment.
This is not very explicit, but it will fail on verify_cap call if validator is not active or pending.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@emmazzz precisely, see the selector on the verify_cap method, it will abort if not found.
crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move
Outdated
Show resolved
Hide resolved
crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move
Show resolved
Hide resolved
crates/sui-framework/packages/sui-system/sources/sui_system_state_inner.move
Outdated
Show resolved
Hide resolved
crates/sui-framework/packages/sui-system/sources/validator_set.move
Outdated
Show resolved
Hide resolved
3a24c5a to
f84d3ee
Compare
dariorussi
left a comment
There was a problem hiding this comment.
thanks for doing this, let's put it in
manolisliolios
left a comment
There was a problem hiding this comment.
Looks great! Logic is so much easier to follow
## 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:
## 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:
Description
Test plan
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.