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

fix(sui): fix sui validator display-metadata for pending validators #20354

Conversation

Thoralf-M
Copy link
Contributor

@Thoralf-M Thoralf-M commented Nov 20, 2024

Description

Fix the DisplayMetadata command when a validator is still pending
Without this change the ValidatorV1 can't be correctly decoded as the first bytes of the bcs are for the Field as the object is a dynamic field resulting in this error: Can't convert bcs bytes of object 0x17792bdce1d0c032e64f5dff96a4e80eb453ab43f290ef6d091b1ebe50a511eb to ValidatorV1: malformed utf8

Porting the fix from iotaledger/iota#3611

Test plan

Running these commands

# increase faucet amount (just setting 30 million didn't work)
sed -i 's/200_000_000_000/4_000_000_000_000_000/g' crates/sui/src/sui_commands.rs
cargo run start --force-regenesis --with-faucet

# other terminal
cargo install --locked --bin sui --path crates/sui
sui client switch --env localnet
# get enough coins
sui client faucet --url http://127.0.0.1:9123/gas
sui client faucet --url http://127.0.0.1:9123/gas
sleep 2 
sui validator make-validator-info validator0 description https://sui.io https://github.com/MystenLabs/sui 127.0.0.1 1000
sui validator become-candidate validator.info
sleep 2
# stake enough coins
for run in {1..8};
do
    coinObjectId=$(sui client gas --json | jq '.[0].gasCoinId')
    validatorAddress=$(sui client active-address)
    sui client call --package 0x3 --module sui_system --function request_add_stake --args 0x5 $coinObjectId $validatorAddress --gas-budget 10000000
done
sleep 2
sui validator join-committee
sleep 2
sui validator display-metadata

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):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI: Fixed the sui validator display-metadata command bug for pending validators.
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Nov 20, 2024

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 Nov 20, 2024 7:27pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 7:27pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 7:27pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Nov 20, 2024 7:27pm

@stefan-mysten
Copy link
Contributor

Thanks @Thoralf-M. I will have a look asap.

@Thoralf-M Thoralf-M temporarily deployed to sui-typescript-aws-kms-test-env November 20, 2024 19:54 — with GitHub Actions Inactive
@stefan-mysten stefan-mysten merged commit 2e86e32 into MystenLabs:main Nov 25, 2024
50 checks passed
@Thoralf-M Thoralf-M deleted the fix-pending-validator-display-metadata branch November 25, 2024 19:09
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