Table of Contents |
---|
...
Verify voters2 table contents match what was in voters before the migration
Register a producer
Register fio_address for producer
Vote for the producer
Verify owner and fio_address are populated as a voter in the accounts voters2 record
Verify voting still works and no regression
Plan:
TODO: Add the post table migration tests above to vote.js. Confirm running them at all phases of contract rollout.
Performance Testing plan
Voteproducer stress testing should be done on voters table before the migration, then voter2 table after the migration. Results will be compared.
Tests carried out on devnet, testnet before deployment to mainnet
...
Chain_plugin update must be released first so more block producers are able to support the new voters table before the contract update has been rolled out
Chain code is in Bahamas
There is a single contract deployment (see below)
For Testnet and Mainnet release, confirm that bloks.io is accessing either the new Table, or getting voter information from the account record.
Work with BPs to update any tools that point to the voters table.
...
After new system contract has been deployed, voteproducer will be called several times by an account with 0 FIO balance. Once migration is complete, the transaction will fail for insufficient balance.
As soon as the contract is live, voteproducer will only move records
If the account has funds, it will take a fee, so only should be called with 0 FIO account.
This copies records over to voters2
Moves 2-3 records
Once the original table is empty, then voteproducer starts working as expected
Retrieve contents of voters2
Verify contents of voters2 with contents of voters, they should contain the original owner account of the producers voted for and an empty fio address field.
Plan to have the migration and verification automated on a script. This should be worked on before contract roll-out.
...
Completed work on table migration. In testing phase. fio.system contract (eosio account) has been updated with the following features:
Voteproducer calls will only migrate 3 vote records over from voters to voters2 table at a time. After the approximate 83 records are moved over, the voteproducer action will function again.
The migration logic will not execute so long as the old voters table stays empty, which should be indefinite or until the contract is updated with the migration logic removed.
All contracts will now use “voters2” in state.
The data should be exact, and the producers that a voter has voted for will not have the respective fio_address item populated for the producer that was voted for at the time previous to the migration. This will be updated on that users next call to voteproducer.
https://github.com/fioprotocol/fio.contracts/pull/33/files
v1/chain/get_account has been updated to search the voters table first, and then the voters2 table. If there is no result from either table the voter_info is treated as null as before.
https://github.com/fioprotocol/fio/pull/230/