witnet / witnet-rust

Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend 👁️🦀
https://docs.witnet.io
GNU General Public License v3.0
180 stars 56 forks source link

feature(data_structures): switch block time when v2.0 activates #2473

Closed drcpu-github closed 1 month ago

drcpu-github commented 2 months ago

This aims to enable switching block time when v2.0 activates. I tested this on a local testnet and it seems to behave properly, but this is obviously a complicated feature.

The most straightforward way to test this feature is probably to add this piece of code in defaults.rs and spin up some nodes:

    fn protocol_versions(&self) -> HashMap<ProtocolVersion, (Epoch, u16)> {
        // [(ProtocolVersion::V1_7, (0, 45))].into_iter().collect()
        [
            (ProtocolVersion::V1_7, (0, 45)),
            (ProtocolVersion::V1_8, (10, 45)),
            (ProtocolVersion::V2_0, (20, 20)),
        ]
        .into_iter()
        .collect()
    }
aesedepece commented 1 month ago

Merged as 7077e79444ae51b0a5c0a59d85e8edd06390d408