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

Add Upgrade transaction for Staking contract #206

Merged
merged 9 commits into from
Feb 8, 2023
Merged

Conversation

joshuahannan
Copy link
Member

Adds contract, transaction, and arguments for the upgrade to the FlowIDTableStaking contract on mainnet

Copy link
Contributor

@peterargue peterargue left a comment

Choose a reason for hiding this comment

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

looks like there are a few differences between the PR (onflow/flow-core-contracts#321) and transactions/update-contract/2023/feb-1/FlowIDTableStaking.cdc. don't forget to pull those in

let approveList: [String] = stakingAccount.load<[String]>(from: /storage/idTableApproveList)
?? panic("Could not load the approve list from storage")

// Create the approve list dictionary with the loaded value, then store the dictionary in the same path
Copy link
Contributor

Choose a reason for hiding this comment

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

approveDict doesn't appear to be stored anywhere

Copy link
Member Author

Choose a reason for hiding this comment

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

yep, this was just a draft. I've tested the transaction now and updated it

@joshuahannan
Copy link
Member Author

@vishalchangrani @Kay-Zee I've added the instructions to the README for doing the multisign with the staking account and service account. Can y'all take a look and let me know if the instructions look good? Thanks!

flow transactions build ./templates/upgrade_nodelists.cdc \
--config-path flow-staking.json \
--network mainnet \
--args-json "$(cat "./transactions/update-contract/2023/feb-8/arguments-update-contract-FlowIDTableStaking-mainnet.json")" \
Copy link
Collaborator

Choose a reason for hiding this comment

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

@vishalchangrani
Copy link
Collaborator

I ran the RLP generation and then tried to sign the generated transaction and ran into this issue:

: encoding/hex: invalid byte: U+000A.

I executed:

  1. flow transactions build ./transactions/update-contract/2023/feb-1/upgrade_nodelists.cdc --config-path flow-staking.json --network mainnet --args-json "$(cat "./transactions/update-contract/2023/feb-1/arguments-update-contract-FlowIDTableStaking-mainnet.json")" --proposer 0x8624b52f9ddcd04a --proposer-key-index 5 --authorizer 0x8624b52f9ddcd04a --payer 0xe467b9dd11fa00df --gas-limit 1000000 -x payload --save ./transactions/update-contract/2023/feb-1/upgrade-nodelists-feb-1-unsigned.rlp
  2. flow transactions sign ./transactions/update-contract/2023/feb-8/upgrade-nodelists-feb-8-unsigned.rlp --config-path flow-staking.json --signer vishal --filter payload --save ./transactions/update-contract/2023/feb-8/upgrade-nodelists-feb-8-sig-1.rlp

@vishalchangrani
Copy link
Collaborator

I ran the RLP generation and then tried to sign the generated transaction and ran into this issue:

: encoding/hex: invalid byte: U+000A.

I executed:

  1. flow transactions build ./transactions/update-contract/2023/feb-1/upgrade_nodelists.cdc --config-path flow-staking.json --network mainnet --args-json "$(cat "./transactions/update-contract/2023/feb-1/arguments-update-contract-FlowIDTableStaking-mainnet.json")" --proposer 0x8624b52f9ddcd04a --proposer-key-index 5 --authorizer 0x8624b52f9ddcd04a --payer 0xe467b9dd11fa00df --gas-limit 1000000 -x payload --save ./transactions/update-contract/2023/feb-1/upgrade-nodelists-feb-1-unsigned.rlp
  2. flow transactions sign ./transactions/update-contract/2023/feb-8/upgrade-nodelists-feb-8-unsigned.rlp --config-path flow-staking.json --signer vishal --filter payload --save ./transactions/update-contract/2023/feb-8/upgrade-nodelists-feb-8-sig-1.rlp

@janezpodhostnik would you know?

fixing path to transaction cdc  file
Copy link
Collaborator

@vishalchangrani vishalchangrani left a comment

Choose a reason for hiding this comment

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

I tested the command to build, sign and send the transactions. Found an issue with Flow cli which has not been fixed. Flow cli needs to be updated to v0.45.2.

@vishalchangrani vishalchangrani merged commit 43650f3 into main Feb 8, 2023
@joshuahannan joshuahannan deleted the update-staking branch February 9, 2023 16:05
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.

3 participants