unit-e
unit-e copied to clipboard
Remove instant finalization
Is your feature request related to a problem? Please describe Instant finalization is not something that will be at the mainnet. I see it as a leftover when we didn't have a finalizer. You usually don't need it but when you need to test finalization, you need to create a validator and then wait for 3 epochs before it gets activated.
Describe the solution you'd like I propose to remove instant finalization completely and hard-code one validator in the chainparams in a similar way how the mainnet setup is.
In this way, we will have more realistic tests, close to the real mainnet setup. Also, it will make easier to simulate justification as we can do it from the epoch=1.
Currently, it's not possible to simulate scenarios when justification is not reached right at the start of the mainnet. Which should be also good to cover.
I just started to suffer some problems derived from "instant finalization" while working on Unit-e network simulations. It slows down our experiments because we have to wait some epochs before connecting all the nodes to the network, so when we have to simulate the conditions under different combinations of network properties & consensus parameters, the whole experiment could be several hours longer.
Regarding your proposed solution, I have some doubts:
hard-code one validator in the chainparams in a similar way how the mainnet setup is.
Not sure about what this exactly means. Do you mean chainparams... or the genesis block?
In my mind after talking with @Gnappuraz , I was thinking on adding deposit transactions to the genesis block, ensure that the genesis block is finalized, and ensure that deposit transactions are gathered from the genesis block... without touching the chain parameters.
@castarco I think genesis block fits better the design then chainparams, so yeah, I think we should go with genesis block. But in the end, what is important is that finalizer's UTXOs are in chainstate DB after we connected genesis block.
But we most likely will have different hard-coded finalizers for mainnet/testnet/regtest so we need a way how to configure that, that's why I mentioned chainparams. But it can be organized in many ways.