ethereum-pocr / kerleano

Information on the Kerleano test network
3 stars 1 forks source link

Restart the kerleano network with new consensus model? #34

Closed guenoledc closed 1 year ago

guenoledc commented 1 year ago

@wiktorhejchman @HallmeSEB @rghoshfinaxys @sjehan @salehmaj

We have now a new version of the consensus that looks better and that resolve a number of points (thanks to @sjehan )

The geth code has changed, the governance smart contract also and the monitoring tool slightly also.

I would like to organize a complete restart of the kerleano network and properly simulate the initialization process and get ready for testing with APL/SGS also.

Please share your opinion on the matter (worth or not, timing, approach ...) before we execute

rghoshfinaxys commented 1 year ago

This is a fabulous opportunity to align all our sealers on the latest geth image :)

Given we'll be synchronizing, could we leverage this action to include initialization of the production network?

wiktorhejchman commented 1 year ago

I think this is a very good idea, both to restart kerleano and sync but also we could maybe initialize the prod network, as I understand it was supposed to happen sometime before the issuance?

We would need to have a bit of time to prepare for a production rollout of all our stuff, it's a copy of acc environment, but there are things to secure like dns, load-balancing etc.

Not sure when do you think we could go ahead with that is it before Christmas or after New Year?

guenoledc commented 1 year ago

I feel that we could start some actions for preparing the production ahead of christmas but the actual start will need to be when we have finalized the APL/SGS work

For the kerleano restart I was hoping to get this done after the intrinsec audit and the reherasal is completed

guenoledc commented 1 year ago

@rghoshfinaxys @wiktorhejchman

How do you want to proceed?

Can we schedule things?

rghoshfinaxys commented 1 year ago

I'd like to have free rein during the update process, so ideally I'd see something like

I can free up a half day for it: if all goes well it shouldn't take more than 30 minutes but it'd be nice to have time in case it doesn't.

I'm available next week, Thursday or Friday. Does this work for you, @guenoledc @wiktorhejchman ?

guenoledc commented 1 year ago

@rghoshfinaxys

I think we need to prepare a bit more ahead of this restart and have a meeting between us to agree on the process.

Maybe we can start documenting what would be required here

I can think of

Anything else?

wiktorhejchman commented 1 year ago

@rghoshfinaxys @guenoledc

I still need to setup few things, fix database backup, preferrably also monitoring, update the code to finaxys latest version with any possible SEB changes considerations, it might take me a bit and I cannot really spend any time this week on it, next week will also be difficult but I can try. Initially, based on the fact that there are still things to do on our side to prepare for that I think I cannot commit to earlier than 8-9.12 at best probably to actually secure half a day for secure and stable relaunch with availability for fixes.

You guys are the experts so please feel free to educate me exactly what we need to have prepared beforehand etc.

guenoledc commented 1 year ago

@wiktorhejchman @rghoshfinaxys Hello, as discussed in today's syndicate call, we have agreed to try to reset the kerleano network on the 13/12/2022.

I will look into what is necessary in the coming days and document the procedure here. Stay tuned pls

guenoledc commented 1 year ago

The elements to collect for the genesis / governance smart contracts

==> These elements will be collected in a config file (pocr-network/genesis/kerleano-conf.json) that reference the name of a governance smart contract that will define the governance parameters. Then the script sc-carbon-footprint/prepare-genesis.js will generate the appropriate genesis file.

Create the genesis file

When all parameters are set in the pocr-network/genesis/kerleano.json, commit on a separate branch kerleano-v2 but starting from try-clear-footprint and create a release with tag. Use https://github.com/ethereum-pocr/ethereum-pocr.github.io/pull/28

When Creating the v2.0.0 tag the .github/workflows/build-and-release-kerleano.yml github workflow will be triggered creating a public realease. The tag will be used to download the file from each node

Building the geth module and related release

in the https://github.com/ethereum-pocr/go-ethereum repo, merge to main (this push the geth to the latest release) and create a release with a tag v1.10.26-pocr-2.0.0 to rebuild and create a geth stored in the assets of that release.

Note that for consistency, the file go-ethereum/params/version.go at line 27 should be aligned to the tag to be able to see in the startup of the node on what version we are. See https://github.com/ethereum-pocr/go-ethereum/pull/37 (now merged)

Should we need to revert, the correct fallback version is v1.10.23

Installing and launching on each existing sealers

As of today, sealers are : SEB

CACIB

Guenole

For each node we should

  1. stop the geth process for both sealers and client nodes
  2. backup the data and binary as a rollback scheme if necessary
  3. clear the data - Attention not the nodekey nor the sealer private key
  4. download the kerleano.json genesis file from https://github.com/ethereum-pocr/ethereum-pocr.github.io/releases/download/${tag}/kerleano.json
  5. download the geth new binary from https://github.com/ethereum-pocr/go-ethereum/releases/download/${tag}/geth
  6. init the new db with the new binary and the new genesis file
  7. start the process
  8. Deploy the new version of https://ethereum-pocr.github.io

Onboarding

Only guenole's node will be a sealer initially, so he will

  1. propose to sealer 1 SEB node
  2. then 1 CACIB node, that SEB will also have to accept
  3. the 2nd SEB node, that both CACIB and SEB must accept
  4. the 2nd CACIB node, that both CACIB and SEB must accept

All sealers will start producing blocks.

Updating the tools

The https://ethereum-pocr.github.io/ site needs to be redeployed with the merge of branch try-clear-footprint to main will trigger the delivery of the github pages

Simulating the auditing of the nodes

Liaise with SGS (Jeronimo ?) and guide him thru the auditing of nodes using Metamask in the https://ethereum-pocr.github.io/ app

guenoledc commented 1 year ago

Resetting the client nodes

For each of our client nodes, we need to drop the data, download the new binary and genesis file. Then reinitialize the geth db and start the process pointing to the other sealers

Resetting the kubernetes applications (essentially the databases)

A simple way to do this is to configure in kubernetes a different name for all the databases so it restart from scratch.

But attention, do not drop the CUSTODY DB tables custody.tokens and custody.wallets that contains only the management of private keys that have nothing to do with the DLT directly, and we do not want to redo the configuration of the wallet station that refers to a private key in the wallet custody db.

Attention in the config, we have two env variables that tells from which block to start synchronizing. We wil have to set these variables to 0 or 1.

So changing the config of the DB and from block and restarting all kubernetes processes should make the process restart synchronization from the beginning of the new chain.

For the Solution DB we can instead delete the collections

For the Custody Service : Keep all data

For the Wallet station service : Keep all data

For the DLT Service : replace the database

guenoledc commented 1 year ago

Evaluating the amount of ₡ needed for the first auditor

So the minimum, if everything works perfectly in the process is to have 20 000.000316 ₡.

For the test, to avoid redoing it, we'll grant SGS 25 001 ₡ in hex 0x61a9

guenoledc commented 1 year ago

Given that SGS will not be able to provide on time a wallet, we are going to create a HD Wallet and provide it to them.

This wallet is to be used from Metamask for the auditor activities.

Metamask only support derivation path m/44'/60'/0'/0/${index}. So we need to provide a 12 english BIP39 words + an index, and they must then use the recover function that clears their current metamask wallets and generate new ones

The Brave browser integrated wallet can perform the same derivation also (just in case)

So, let's consider the index = 0 so the derivation path m/44'/60'/0'/0/0 and the 12 words (not copied here) that gives the address 0xacf6441aa2b10726a273f3963a593104f11e4693