leapdao / meta

Everything meta and not-fitting to other repos
Creative Commons Attribution Share Alike 4.0 International
9 stars 7 forks source link

upgrade operator contract on testnet #202

Closed johannbarbie closed 4 years ago

johannbarbie commented 4 years ago

Bounty

with the current contract ~CAS~ heartbeats and better slot management is not supported.

Scope

Deliverables

Gain for the project

Roles

bounty gardener: @johannbarbie / 10% bounty worker: name / share bounty reviewer: name / share

johannbarbie commented 4 years ago

started testing the upgrade locally, got this:

2020-01-10T14:59:23.989Z leap-node:period [submitPeriod] Error Error: Transaction has been reverted by the EVM:
{
  "transactionHash": "0x38a97024e42aef5e311a2ad4555431192d1768efa2859a5f83898b170022b8f7",
  "transactionIndex": 0,
  "blockHash": "0x3920f38ec033398cc2a87745ee85087931374a40cc813b9f7c5494e667305ad6",
  "blockNumber": 4366,
  "from": "0x8f4d90553b596d132a2c876fea27e3294cebb8e4",
  "to": "0x9f551cb197e4357bab7799dd0930a1fe3a93978e",
  "gasUsed": 29072,
  "cumulativeGasUsed": 29072,
  "contractAddress": null,
  "logs": [],
  "status": false,
  "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "v": "0x2d45",
  "r": "0xd5d3e8e2239d2578fdcd722977dd1cdb6179e5309528294ce554e5ec27a23300",
  "s": "0x79acf7d4164f51df45af554f74a733afbf780c0591dba0232bf85c6075e95771"
}
    at /Users/johba/dev/leap-sandbox/build/node/node_modules/web3-core-method/src/index.js:364:46
    at processTicksAndRejections (internal/process/task_queues.js:86:5)

suspicion: the slots-bitmap is set to 0 after upgrade, even though some slots are taken already.

johannbarbie commented 4 years ago

ok, with this PR the upgrade works on local network. here is what i did:

leap-contracts johba$ git checkout 8d61b6c0a5009f26949bad01de8c2b9aa77c7476
leap-contracts johba$ cd leap-sandbox
leap-sandbox johba$ yarn build
leap-sandbox johba$ yarn start
leap-contracts johba$ cd leap-guardian
leap-guardian johba$ NUM=64 NODE_URL=http://localhost:7000 PRIV_KEY=0x11..22 node scripts/machineGun.js
leap-guardian johba$ cd leap-contracts
leap-contracts johba$ git checkout fix/takenSlotsUgrade
leap-contracts johba$ CONFIG=$SB/generatedConfig.json truffle deploy --f 5
leap-contracts johba$ cd leap-guardian
leap-guardian johba$ NUM=96 NODE_URL=http://localhost:7000 PRIV_KEY=0x11..22 node scripts/machineGun.js

if period submission would fail, then machine-gun would stop.

troggy commented 4 years ago

@johannbarbie 👍👍

One thing to keep in mind: leap-node version for such tests should be the same as on testnet (if contract upgrade will be done before node upgrade)

johannbarbie commented 4 years ago

if contract upgrade will be done before node upgrade

as the first machine gun run was able to pass a period submission i guess there is no danger to upgrade nodes before upgrading contracts? 🤔

johannbarbie commented 4 years ago

contract deployed an verified at: https://rinkeby.etherscan.io/address/0xd5588c166bc53e9360320ee0fe2daf7b510718ce

troggy commented 4 years ago

I'm on it. leap-node is good enough for testnet

contract deployed an verified at: https://rinkeby.etherscan.io/address/0xd5588c166bc53e9360320ee0fe2daf7b510718ce

There was one more change since this deployment. Will create a new leap-contracts release and deploy the latest version

troggy commented 4 years ago
troggy commented 4 years ago

contracts upgraded

troggy commented 4 years ago

Updated params: https://github.com/leapdao/meta/blob/master/playbook/operations/testnet/README.md

Deployment logs: https://github.com/leapdao/meta/blob/master/playbook/operations/testnet/upgrades/5-testnet-upgrade-170220.md

johannbarbie commented 4 years ago

reviewed contract deployment by: