diff --git a/version-compatibility/forkless-upgrade/Cargo.toml b/version-compatibility/forkless-upgrade/Cargo.toml index 33411ab9388..0792f3c6fc7 100644 --- a/version-compatibility/forkless-upgrade/Cargo.toml +++ b/version-compatibility/forkless-upgrade/Cargo.toml @@ -17,8 +17,8 @@ tokio = { version = "1.37.0", features = ["rt-multi-thread"] } # Neutral deps fuel-core-trace = { path = "../../crates/trace" } -fuel-crypto = { version = "0.49.0" } -fuel-tx = { version = "0.49.0", features = ["random"] } +fuel-crypto = { version = "0.57.0" } +fuel-tx = { version = "0.57.0", features = ["random"] } # Latest fuel-core latest-fuel-core-bin = { path = "../../bin/fuel-core", package = "fuel-core-bin", features = [ @@ -29,10 +29,9 @@ latest-fuel-core-type = { path = "../../crates/types", package = "fuel-core-type "test-helpers", ] } latest-fuel-core-client = { path = "../../crates/client", package = "fuel-core-client" } -# TODO: https://github.com/FuelLabs/fuel-core/issues/2198 -#latest-fuel-core-upgradable-executor = { path = "../../crates/services/upgradable-executor", package = "fuel-core-upgradable-executor", features = [ -# "wasm-executor", -#] } +latest-fuel-core-upgradable-executor = { path = "../../crates/services/upgradable-executor", package = "fuel-core-upgradable-executor", features = [ + "wasm-executor", +] } # Genesis fuel-core genesis-fuel-core-bin = { version = "0.26.0", package = "fuel-core-bin", features = [ @@ -41,3 +40,11 @@ genesis-fuel-core-bin = { version = "0.26.0", package = "fuel-core-bin", feature ] } genesis-fuel-core-client = { version = "0.26.0", package = "fuel-core-client" } genesis-fuel-core-services = { version = "0.26.0", package = "fuel-core-services" } + +# Fuel core version 0.36.0 +version-36-fuel-core-bin = { version = "0.36.0", package = "fuel-core-bin", features = [ + "parquet", + "p2p", +] } +version-36-fuel-core-client = { version = "0.36.0", package = "fuel-core-client" } +version-36-fuel-core-services = { version = "0.36.0", package = "fuel-core-services" } diff --git a/version-compatibility/forkless-upgrade/chain-configurations/v36/README.md b/version-compatibility/forkless-upgrade/chain-configurations/v36/README.md new file mode 100644 index 00000000000..f798abaf3ab --- /dev/null +++ b/version-compatibility/forkless-upgrade/chain-configurations/v36/README.md @@ -0,0 +1,10 @@ +# The configuration of the V36 network + +This configuration was generated in the following way: +1. Get the `fuel-core` from `release/v0.36.0` branch (commit b5d5ff8d13f16a0bd53e79ee0e8f5438971be2b9) +2. Build and run in order to create a DB +3. Run again with the `snapshot` parameter +4. Apply the following modifications to `chain_config.json` + - PoA Key: `{"address":"3ba3b213c8d5ec4d4901ac34b0e924d635384a8b0a5df6e116bce9a783da8e02","secret":"e3d6eb39607650e22f0befa26d52e921d2e7924d0e165f38ffa8d9d0ac73de93","type":"block_production"}` + - Privileged Key: `{"address":"f034f7859dbf1d775cba16fc175eef249a045d6484a8b9388c9e280267125b73","secret":"dcbe36d8e890d7489b6e1be442eab98ae2fdbb5c7d77e1f9e1e12a545852304f","type":"block_production"}` + - Change "chain_name" from "Local testnet" to "V36" \ No newline at end of file diff --git a/version-compatibility/forkless-upgrade/chain-configurations/v36/chain_config.json b/version-compatibility/forkless-upgrade/chain-configurations/v36/chain_config.json new file mode 100644 index 00000000000..755437c0f86 --- /dev/null +++ b/version-compatibility/forkless-upgrade/chain-configurations/v36/chain_config.json @@ -0,0 +1,307 @@ +{ + "chain_name": "V36", + "consensus_parameters": { + "V2": { + "tx_params": { + "V1": { + "max_inputs": 255, + "max_outputs": 255, + "max_witnesses": 255, + "max_gas_per_tx": 30000000, + "max_size": 112640, + "max_bytecode_subsections": 256 + } + }, + "predicate_params": { + "V1": { + "max_predicate_length": 102400, + "max_predicate_data_length": 102400, + "max_message_data_length": 102400, + "max_gas_per_predicate": 30000000 + } + }, + "script_params": { + "V1": { + "max_script_length": 102400, + "max_script_data_length": 102400 + } + }, + "contract_params": { + "V1": { + "contract_max_size": 102400, + "max_storage_slots": 1760 + } + }, + "fee_params": { + "V1": { + "gas_price_factor": 92000, + "gas_per_byte": 63 + } + }, + "chain_id": 0, + "gas_costs": { + "V4": { + "add": 2, + "addi": 2, + "and": 2, + "andi": 2, + "bal": 29, + "bhei": 2, + "bhsh": 2, + "burn": 19976, + "cb": 2, + "cfsi": 2, + "div": 2, + "divi": 2, + "eck1": 1907, + "ecr1": 26135, + "eq": 2, + "exp": 2, + "expi": 2, + "flag": 2, + "gm": 2, + "gt": 2, + "gtf": 13, + "ji": 2, + "jmp": 2, + "jne": 2, + "jnei": 2, + "jnzi": 2, + "jmpf": 2, + "jmpb": 2, + "jnzf": 2, + "jnzb": 2, + "jnef": 2, + "jneb": 2, + "lb": 2, + "log": 102, + "lt": 2, + "lw": 2, + "mint": 18042, + "mlog": 2, + "mod": 2, + "modi": 2, + "move": 2, + "movi": 2, + "mroo": 4, + "mul": 2, + "muli": 2, + "mldv": 3, + "noop": 1, + "not": 2, + "or": 2, + "ori": 2, + "poph": 3, + "popl": 3, + "pshh": 5, + "pshl": 5, + "ret_contract": 53, + "rvrt_contract": 52, + "sb": 2, + "sll": 2, + "slli": 2, + "srl": 2, + "srli": 2, + "srw": 177, + "sub": 2, + "subi": 2, + "sw": 2, + "sww": 17302, + "time": 35, + "tr": 27852, + "tro": 19718, + "wdcm": 2, + "wqcm": 2, + "wdop": 3, + "wqop": 3, + "wdml": 3, + "wqml": 3, + "wddv": 4, + "wqdv": 5, + "wdmd": 8, + "wqmd": 12, + "wdam": 7, + "wqam": 8, + "wdmm": 8, + "wqmm": 8, + "xor": 2, + "xori": 2, + "aloc": { + "LightOperation": { + "base": 2, + "units_per_gas": 15 + } + }, + "bsiz": { + "LightOperation": { + "base": 17, + "units_per_gas": 790 + } + }, + "bldd": { + "LightOperation": { + "base": 15, + "units_per_gas": 272 + } + }, + "cfe": { + "LightOperation": { + "base": 10, + "units_per_gas": 1818181 + } + }, + "cfei": { + "LightOperation": { + "base": 2, + "units_per_gas": 1000000 + } + }, + "call": { + "LightOperation": { + "base": 13513, + "units_per_gas": 7 + } + }, + "ccp": { + "LightOperation": { + "base": 34, + "units_per_gas": 39 + } + }, + "croo": { + "LightOperation": { + "base": 91, + "units_per_gas": 3 + } + }, + "csiz": { + "LightOperation": { + "base": 31, + "units_per_gas": 438 + } + }, + "ed19": { + "LightOperation": { + "base": 3000, + "units_per_gas": 214 + } + }, + "k256": { + "LightOperation": { + "base": 27, + "units_per_gas": 5 + } + }, + "ldc": { + "LightOperation": { + "base": 43, + "units_per_gas": 102 + } + }, + "logd": { + "LightOperation": { + "base": 363, + "units_per_gas": 4 + } + }, + "mcl": { + "LightOperation": { + "base": 2, + "units_per_gas": 1041 + } + }, + "mcli": { + "LightOperation": { + "base": 2, + "units_per_gas": 1025 + } + }, + "mcp": { + "LightOperation": { + "base": 4, + "units_per_gas": 325 + } + }, + "mcpi": { + "LightOperation": { + "base": 8, + "units_per_gas": 511 + } + }, + "meq": { + "LightOperation": { + "base": 3, + "units_per_gas": 940 + } + }, + "retd_contract": { + "LightOperation": { + "base": 305, + "units_per_gas": 4 + } + }, + "s256": { + "LightOperation": { + "base": 31, + "units_per_gas": 4 + } + }, + "scwq": { + "HeavyOperation": { + "base": 16346, + "gas_per_unit": 17163 + } + }, + "smo": { + "LightOperation": { + "base": 40860, + "units_per_gas": 2 + } + }, + "srwq": { + "HeavyOperation": { + "base": 187, + "gas_per_unit": 179 + } + }, + "swwq": { + "HeavyOperation": { + "base": 17046, + "gas_per_unit": 16232 + } + }, + "contract_root": { + "LightOperation": { + "base": 31, + "units_per_gas": 2 + } + }, + "state_root": { + "HeavyOperation": { + "base": 236, + "gas_per_unit": 122 + } + }, + "new_storage_per_byte": 63, + "vm_initialization": { + "LightOperation": { + "base": 3957, + "units_per_gas": 48 + } + } + } + }, + "base_asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07", + "block_gas_limit": 30000000, + "block_transaction_size_limit": 129024, + "privileged_address": "f034f7859dbf1d775cba16fc175eef249a045d6484a8b9388c9e280267125b73" + } + }, + "genesis_state_transition_version": 11, + "consensus": { + "PoAV2": { + "genesis_signing_key": "3ba3b213c8d5ec4d4901ac34b0e924d635384a8b0a5df6e116bce9a783da8e02", + "signing_key_overrides": {} + } + } +} \ No newline at end of file diff --git a/version-compatibility/forkless-upgrade/chain-configurations/v36/metadata.json b/version-compatibility/forkless-upgrade/chain-configurations/v36/metadata.json new file mode 100644 index 00000000000..933a36e11a5 --- /dev/null +++ b/version-compatibility/forkless-upgrade/chain-configurations/v36/metadata.json @@ -0,0 +1,8 @@ +{ + "chain_config": "chain_config.json", + "table_encoding": { + "Json": { + "filepath": "state_config.json" + } + } +} \ No newline at end of file diff --git a/version-compatibility/forkless-upgrade/chain-configurations/v36/state_config.json b/version-compatibility/forkless-upgrade/chain-configurations/v36/state_config.json new file mode 100644 index 00000000000..8087ca67338 --- /dev/null +++ b/version-compatibility/forkless-upgrade/chain-configurations/v36/state_config.json @@ -0,0 +1,152 @@ +{ + "coins": [ + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000001", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "6b63804cfbf9856e68e5b6e7aef238dc8311ec55bec04df774003a2c96e0418e", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000002", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "54944e5b8189827e470e5a8bacfc6c3667397dc4e1eef7ef3519d16d6d6c6610", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000003", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "e10f526b192593793b7a1559a391445faba82a1d669e3eb2dcd17f9c121b24b1", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000004", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "577e424ee53a16e6a85291feabc8443862495f74ac39a706d2dd0b9fc16955eb", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000005", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "c36be0e14d3eaf5d8d233e0f4a40b3b4e48427d25f84c460d2b03b242a38479e", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000006", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "a1184d77d0d08a064e03b2bd9f50863e88faddea4693a05ca1ee9b1732ea99b7", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000007", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "b5566df884bee4e458151c2fe4082c8af38095cc442c61e0dc83a371d70d88fd", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000008", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "9da7247e1d63d30d69f136f0f8654ee8340362c785b50f0a60513c7edbf5bb7c", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "0000000000000000000000000000000000000000000000000000000000000009", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "4b2ca966aad1a9d66994731db5138933cf61679107c3cde2a10d9594e47c084e", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "000000000000000000000000000000000000000000000000000000000000000a", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "26183fbe7375045250865947695dfc12500dcc43efb9102b4e8c4d3c20009dcb", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "000000000000000000000000000000000000000000000000000000000000000b", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "81f3a10b61828580d06cc4c7b0ed8f59b9fb618be856c55d33decd95489a1e23", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "000000000000000000000000000000000000000000000000000000000000000c", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "587aa0482482efea0234752d1ad9a9c438d1f34d2859b8bef2d56a432cb68e33", + "amount": 1152921504606846976, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + }, + { + "tx_id": "000000000000000000000000000000000000000000000000000000000000000d", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "owner": "53a9c6a74bee79c5e04115a007984f4bddaafed75f512f68766c6ed59d0aedec", + "amount": 1125899906842624, + "asset_id": "f8f8b6283d7fa5b672b530cbb84fcccb4ff8dc40f8176ef4544ddb1f1952ad07" + } + ], + "messages": [], + "blobs": [], + "contracts": [ + { + "contract_id": "7777777777777777777777777777777777777777777777777777777777777777", + "code": "900000097b4b30b2437b0073e5ba5a9324cf55831d180a89f66332b541827e12e647b7516140000a504d00205d4d30001a4860004945048076440001240400005050c0043d51345024040000", + "tx_id": "0000000000000000000000000000000000000000000000000000000000000000", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "states": [], + "balances": [] + }, + { + "contract_id": "7e2becd64cd598da59b4d1064b711661898656c6b1f4918a787156b8965dc83c", + "code": "1af030007400000200000000000014605dffc00110ffff00740000001aec500091000b285d43f015104103001a4460005d4d10491b441000104934405d47f008104404405d4920001b44144010453440504fb0205fed10045fed20055047ba8872500010284535005047ba88504fb46072500010284d15005d453000504fb0105fed10025fed20035047ba2872480010284534805047ba285fed00005d43f0085fed00015043b2d0724800102843b480504bb650724c0010284914c05047b660724c0010284504c01ae920001ae5100020f8330058fbe00250fbe0047400041a1a43d00076400001740000a71a4060005d41004a1b441000104104405047ba9872480020284504805043ba985047b03072480020284504805043b0b072480020284114805047b95072480020284504805043b95071440006504bb0f8724c0020284914c05047b890724c0020284504c05043b8f0724c0020284124c0a1411420764000065043b2e05fec005c504bb7907244001028490440740000085043b2805fec10505045000f5c4bf0505e452000504bb79072440010284904405d43f00b264000001a4070005fed01365d43f00b5fed01375fec01385057b9b05043b53072440010284124405d43b0f213410000764000475d43b0a613410040764000025d43f00c364000005043b5305041000f5c4100001ae810001ae5500020f8330058fbe00250fbe0047400042e5d4550005d4950015d4d5002104d3040165124c076500001135124c0765000065047b3605fec006c504fb7a072480018284d14807400000d124d3480104d30401b4d24c0264c0000281d14801a447000504bb1185fec10235fed10245fed3025504fb7a072440018284d24405047b54072480018284534805d47b0f4134510007644000f5d47b0a813451040764400025d43f00c364000005047b54050451008504bb5405049200850492008724c0008285514c050455008724c0008284524c05d4550005d4950021b481480104514805e4500005d415002104100405f550002740000061ae800001ae5500020f8330058fbe00250fbe004740003ef5043b9b050450010504bb1e0724c0008284904c050412008724c0008284114c05043ba3872440010284124405043ba385047b6c072480010284504801ae9100020f8330058fbe00250fbe004740004311a43d0005047ba38504bb780724c0010284914c01ae9200020f8330058fbe00250fbe004740003c01a47d000254110005d43f016104103005047ba28504bb3505fed006a5d43f00d5fed006b5043b3f0724c0010284124c0504bb670724c0010284914c05047b710724c0010284504c01ae920001ae5100020f8330058fbe00250fbe0047400035a1a43d000764000017400012f1a4060005d41004a1b441000104104405047bab872480020284504805043bab85047b05072480020284504805043b13072480020284114805047b97072480020284504805043b97071440006504bb150724c0020284914c05047b8b0724c0020284504c05043b910724c0020284124c0a1411420764000065043b3105fec0062504bb7b872440020284904407400002d5043b2905fec10525047b6405d4bf01710492300724c0008284524c05d4bf008264800001a4c7000284d14805047b1f05fed303e5d4bf00f5fed203f504bb470724c0010284914c05d492001504fb48072500010284d15005d4530001b492040504fb4b05fed10965fed20975047b4c072480010284534805d451000504bb4d072500010284935005d4920015053b4e072540010285135405d4d40015fed10535fed20545fed3055504bb7b872440020284904405d43f00b264000001a4070005fed01395d43f00b5fed013a5fec013b5057b9c85043b58872440020284124405d43b0f713410000764000aa5d43b0b113410040764000025d43f00c364000005043b588504100085047baf872480018284504801ae810001ae5500020f8330058fbe00250fbe00474000347505bbaf85d43b1615d4550005d4950015d4d50025d53f008104d3500165124c076500001135124c0765000065047b3a85fec0075504fb7d872480018284d14807400000d124d3480104d30401b4d24c0264c0000281d14801a447000504bb1705fec102e5fed102f5fed3030504fb7d872440018284d24405047b5d872480018284534805d47b0fb134510007644000f5d47b0bb13451040764400025d43f00c364000005047b5d850451008504bb5d85049200850492008724c0008285514c050455008724c0008284524c05d4550005d4950021b481480104514805f4500005d4150025d47f008104104405f5500021a5c00005d41600216417400764000017400005f5d416002164505c076440001134505c07644000b5d416000104105c05047b2f05fec105e5c4100005049100f5e490000504bb7f07240001028491400740000055043b0705fec000e504bb7f072440010284904405043b62072440010284124405d43b0fe1341004076400001360000005043b6205041000f5c4100005d4550005d4950015d4d5002104d3040165124c076500001135124c0765000065047b3785fec006f504fb80072480018284d14807400000d124d3480104d30401b4d24c0264c0000281d14801a447000504bb2005fec10405fed10415fed3042504fb80072440018284d24405047b55872480018284534805d47b100134510007644000f5d47b0ab13451040764400025d43f00c364000005047b55850451008504bb5585049200850492008724c0008285514c050455008724c0008284524c05d4550005d4950021b481480104514805e4500005d415002104100405f550002105d70407500005b1ae800001ae5500020f8330058fbe00250fbe004740002a75043b9c850450010504bb260724c0008284904c050412008724c0008284114c05043ba4872440010284124405043ba485047b6d072480010284504801ae9100020f8330058fbe00250fbe004740002e91a43d0005047ba48504bb680724c0010284914c01ae9200020f8330058fbe00250fbe004740002781a47d000254110005d43f018104103005047ba28504bb4005fed00805d43f0105fed00815043b410724c0010284124c0504bb720724c0010284914c05047b730724c0010284504c01ae920001ae5100020f8330058fbe00250fbe004740002121a43d000764000017400012f1a4060005d41004a1b441000104104405047bad872480020284504805043bad85047b08072480020284504805043b18872480020284114805047b99072480020284504805043b99071440006504bb1a8724c0020284914c05047b8d0724c0020284504c05043b930724c0020284124c0a1411420764000065043b3305fec0066504bb81872440020284904407400002d5043b2b05fec10565047b6485d4bf01910492300724c0008284524c05d4bf008264800001a4c7000284d14805047b2185fed30435d4bf0125fed2044504bb4f0724c0010284914c05d492001504fb50072500010284d15005d4530001b492040504fb5105fed10a25fed20a35047b52072480010284534805d451000504bb49072500010284935005d4920015053b4a072540010285135405d4d40015fed10575fed20585fed3059504bb81872440020284904405d43f00b264000001a4070005fed013c5d43f00b5fed013d5fec013e5057b9e05043b5a872440020284124405d43b10313410000764000aa5d43b0b513410040764000025d43f00c364000005043b5a8504100085047bb1072480018284504801ae810001ae5500020f8330058fbe00250fbe004740001ff505bbb105d43b1645d4550005d4950015d4d50025d53f008104d3500165124c076500001135124c0765000065047b3c05fec0078504fb83872480018284d14807400000d124d3480104d30401b4d24c0264c0000281d14801a447000504bb1c85fec10395fed103a5fed303b504fb83872440018284d24405047b5f072480018284534805d47b107134510007644000f5d47b0be13451040764400025d43f00c364000005047b5f050451008504bb5f05049200850492008724c0008285514c050455008724c0008284524c05d4550005d4950021b481480104514805f4500005d4150025d47f008104104405f5500021a5c00005d41600216417400764000017400005f5d416002164505c076440001134505c07644000b5d416000104105c05047b3005fec10605c4100005049100f5e490000504bb8507240001028491400740000055043b0a05fec0014504bb85072440010284904405043b63072440010284124405d43b10a1341004076400001360000005043b6305041000f5c4100005d4550005d4950015d4d5002104d3040165124c076500001135124c0765000065047b3905fec0072504fb86072480018284d14807400000d124d3480104d30401b4d24c0264c0000281d14801a447000504bb2285fec10455fed10465fed3047504fb86072440018284d24405047b57072480018284534805d47b10c134510007644000f5d47b0ae13451040764400025d43f00c364000005047b57050451008504bb5705049200850492008724c0008285514c050455008724c0008284524c05d4550005d4950021b481480104514805e4500005d415002104100405f550002105d70407500005b1ae800001ae5500020f8330058fbe00250fbe0047400015f5043b9e050450010504bb270724c0008284904c050412008724c0008284114c05043ba5872440010284124405043ba585047b6e072480010284504801ae9100020f8330058fbe00250fbe004740001a11a43d0005047ba58504bb690724c0010284914c01ae9200020f8330058fbe00250fbe004740001301a47d000254110005d43f01a104103005047ba28504bb4205fed00845d43f0135fed00855043b430724c0010284124c0504bb740724c0010284914c05047b750724c0010284504c01ae920001ae5100020f8330058fbe00250fbe004740000ca1a43d00076400001740000635d43f00b264000001a4070005fed013f5d43f00b5fed01405fec01415053b9f85d43b13f5d47b1405d4bb1415d4ff008104924c0164d1480764c0001134d1480764c00065043b3d85fec007b504bb87872440018284904407400000d12492440104920401b49148026480000281d04401a4070005047b0d05fec101a5fed001b5fed201c504bb87872400018284914005043b60872440018284124405d43b10f134100007640000f5d43b0c113410040764000025d43f00c364000005043b608504100085047b608504510085045100872480008285104805041400872480008284114805d4140005d4540021b441440104104401a4410005f4110005d4140025d47f008104104405f5100025043b9f850450010504bb240724c0008284904c050412008724c0008284114c05043ba6872440010284124405043ba685047b6f072480010284504801ae9100020f8330058fbe00250fbe004740001251a43d0005047ba68504bb6a0724c0010284914c01ae9200020f8330058fbe00250fbe004740000b41a47d000254110005d43f01b104103005047ba28504bb4405fed00885d43f0135fed00895043b450724c0010284124c0504bb760724c0010284914c05047b770724c0010284504c01ae920001ae5100020f8330058fbe00250fbe0047400004e1a43d00076400001740000495043b2505fec004a5d47f00b264400001a4470005fed11425d47f00b5fed11435fec01445047ba10504bb5c8724c0010284904c05d43b04a13410000764000135d43b0b913410040764000025d43f00c364000005d43b0ba1ae810001ae5100020f8330058fbe00250fbe0047400008e1ae900001ae5100020f8330058fbe00250fbe00474000088740000061ae800001ae5100020f8330058fbe00250fbe004740000815043ba1050450010504bb0e8724c0008284904c050412008724c0008284114c05043ba7872440010284124405043ba785047b70072480010284504801ae9100020f8330058fbe00250fbe004740000c31a43d0005047ba78504bb6b0724c0010284914c01ae9200020f8330058fbe00250fbe004740000521a47d000254110005d43f014364000009500003f960800001aec5000910000501a43a0001a4790001a4be000724c001028ed04c01aebb00020f8330058fbe00250fbe004740000301a4fd0005053b01072540010285115401ae9400020f8330058fbe00250fbe004740000271a53d000134d3500134d30001a500000764c001c504fb03072500010284d05001ae9300020f8330058fbe00250fbe004740000811a4fd0005053b04072540010285115401ae9400020f8330058fbe00250fbe004740000781a47d0005053b02072540010285105401ae9400020f8330058fbe00250fbe004740000081a43d000295134501af54000920000501af92000980800009700003f4af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100011af50000920000101af9100098080000970000074af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d410001124100401af50000920000101af9100098080000970000074af800009500007f960800001aec5000910000601a4fa0001a5790001a53e0005d5950005d4150015d4550025d4bf00810451480164904407648000113490440764800065043b0185fec0003504bb04872440018284904407400000c12451400104510401b45044026440000281d64001a4070005fec10005fed00015fed1002504bb04872400018284bb4005043b03072440018284124405d43b009134100007640000f5d43b00613410040764000025d43f00c364000005043b030504100085047b030504510085045100872480008285504805041500872480008284114805d4150005d4550021b441440104104405f4130005d4150025d47f008104104405f5500021af40000920000601af94000980800009700007f4af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100001af50000920000101af9100098080000970000074af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100001af50000920000101af9100098080000970000074af8000047000000646563696d616c736e616d650000000073796d626f6c0000746f74616c5f61737365747300000000746f74616c5f737570706c790000000000000000000002480000000000000008000000000000025009000000000000000000000000000400cccccccccccc0002000000000000000445746865720000000000000000000005000000000000000645544800000000000000000000000003000000000000000c000000000000007b0000000000001460000000000000146800000000000014d0000000000000147000000000000014e800000000000014780000000000001488", + "tx_id": "0000000000000000000000000000000000000000000000000000000000000001", + "output_index": 0, + "tx_pointer_block_height": 0, + "tx_pointer_tx_idx": 0, + "states": [], + "balances": [] + } + ], + "last_block": { + "block_height": 0, + "da_block_height": 0, + "consensus_parameters_version": 0, + "state_transition_version": 11, + "blocks_root": "801049f397f4fae0edc37c3496f0e78bd2c6a02d3971b4627e8224d257e19258" + } +} \ No newline at end of file diff --git a/version-compatibility/forkless-upgrade/chain-configurations/v36/state_transition_bytecode.wasm b/version-compatibility/forkless-upgrade/chain-configurations/v36/state_transition_bytecode.wasm new file mode 100644 index 00000000000..d2ec849cc27 Binary files /dev/null and b/version-compatibility/forkless-upgrade/chain-configurations/v36/state_transition_bytecode.wasm differ diff --git a/version-compatibility/forkless-upgrade/src/backward_compatibility.rs b/version-compatibility/forkless-upgrade/src/backward_compatibility.rs index 229f9eadb75..f1782702526 100644 --- a/version-compatibility/forkless-upgrade/src/backward_compatibility.rs +++ b/version-compatibility/forkless-upgrade/src/backward_compatibility.rs @@ -2,8 +2,10 @@ use crate::tests_helper::{ default_multiaddr, GenesisFuelCoreDriver, LatestFuelCoreDriver, + Version36FuelCoreDriver, IGNITION_TESTNET_SNAPSHOT, POA_SECRET_KEY, + V36_TESTNET_SNAPSHOT, }; use latest_fuel_core_type::{ fuel_tx::Transaction, @@ -25,6 +27,8 @@ use libp2p::{ }; use std::time::Duration; +const BLOCK_INCLUSION_TIMEOUT: Duration = Duration::from_secs(360); + #[tokio::test] async fn latest_binary_is_backward_compatible_and_can_load_testnet_config() { // When @@ -109,7 +113,76 @@ async fn latest_binary_is_backward_compatible_and_follows_blocks_created_by_gene // Then for i in 0..BLOCKS_TO_PRODUCE { - let _ = tokio::time::timeout(Duration::from_secs(120), imported_blocks.next()) + let _ = tokio::time::timeout(BLOCK_INCLUSION_TIMEOUT, imported_blocks.next()) + .await + .expect(format!("Timed out waiting for block import {i}").as_str()) + .expect(format!("Failed to import block {i}").as_str()); + } +} + +#[tokio::test] +async fn latest_binary_is_backward_compatible_and_follows_blocks_created_by_v36_binary() { + // Given + let v36_keypair = SecpKeypair::generate(); + let hexed_secret = hex::encode(v36_keypair.secret().to_bytes()); + let v36_port = "30333"; + let v36_node = Version36FuelCoreDriver::spawn(&[ + "--service-name", + "V36Producer", + "--debug", + "--poa-instant", + "true", + "--consensus-key", + POA_SECRET_KEY, + "--snapshot", + V36_TESTNET_SNAPSHOT, + "--enable-p2p", + "--keypair", + hexed_secret.as_str(), + "--peering-port", + v36_port, + ]) + .await + .unwrap(); + let public_key = Keypair::from(v36_keypair).public(); + let v36_peer_id = PeerId::from_public_key(&public_key); + let v36_multiaddr = default_multiaddr(v36_port, v36_peer_id); + + // Starting node that uses latest fuel core. + // It will connect to the v36 node and sync blocks. + let latest_keypair = SecpKeypair::generate(); + let hexed_secret = hex::encode(latest_keypair.secret().to_bytes()); + let latest_node = LatestFuelCoreDriver::spawn(&[ + "--service-name", + "LatestValidator", + "--debug", + "--poa-instant", + "false", + "--snapshot", + V36_TESTNET_SNAPSHOT, + "--enable-p2p", + "--keypair", + hexed_secret.as_str(), + "--reserved-nodes", + v36_multiaddr.as_str(), + "--peering-port", + "0", + ]) + .await + .unwrap(); + let mut imported_blocks = latest_node.node.shared.block_importer.events(); + + // When + const BLOCKS_TO_PRODUCE: u32 = 10; + v36_node + .client + .produce_blocks(BLOCKS_TO_PRODUCE, None) + .await + .unwrap(); + + // Then + for i in 0..BLOCKS_TO_PRODUCE { + let _ = tokio::time::timeout(BLOCK_INCLUSION_TIMEOUT, imported_blocks.next()) .await .expect(format!("Timed out waiting for block import {i}").as_str()) .expect(format!("Failed to import block {i}").as_str()); diff --git a/version-compatibility/forkless-upgrade/src/forward_compatibility.rs b/version-compatibility/forkless-upgrade/src/forward_compatibility.rs index f18b19b78cf..3523468f430 100644 --- a/version-compatibility/forkless-upgrade/src/forward_compatibility.rs +++ b/version-compatibility/forkless-upgrade/src/forward_compatibility.rs @@ -6,7 +6,7 @@ use crate::tests_helper::{ default_multiaddr, transactions_from_subsections, upgrade_transaction, - GenesisFuelCoreDriver, + Version36FuelCoreDriver, IGNITION_TESTNET_SNAPSHOT, POA_SECRET_KEY, SUBSECTION_SIZE, @@ -31,24 +31,24 @@ use rand::{ use std::time::Duration; #[tokio::test] -async fn latest_state_transition_function_is_forward_compatible_with_genesis_binary() { - // The test has a genesis block producer and one genesis validator. - // Genesis nodes execute several blocks by using the genesis state transition function. +async fn latest_state_transition_function_is_forward_compatible_with_v36_binary() { + // The test has a v36 block producer and one v36 validator. + // v36 nodes execute several blocks by using the v36 state transition function. // At some point, we upgrade the network to use the latest state transition function. // The network should be able to generate several new blocks with a new version. - // Genesis block producer and validator should process all blocks. + // v36 block producer and validator should process all blocks. // // These actions test that old nodes could use a new state transition function, // and it is forward compatible. // // To simplify the upgrade of the network `utxo_validation` is `false`. - let genesis_keypair = SecpKeypair::generate(); - let hexed_secret = hex::encode(genesis_keypair.secret().to_bytes()); - let genesis_port = "40333"; - let genesis_node = GenesisFuelCoreDriver::spawn(&[ + let v36_keypair = SecpKeypair::generate(); + let hexed_secret = hex::encode(v36_keypair.secret().to_bytes()); + let v36_port = "40333"; + let v36_node = Version36FuelCoreDriver::spawn(&[ "--service-name", - "GenesisProducer", + "V36Producer", "--debug", "--poa-instant", "true", @@ -60,21 +60,21 @@ async fn latest_state_transition_function_is_forward_compatible_with_genesis_bin "--keypair", hexed_secret.as_str(), "--peering-port", - genesis_port, + v36_port, ]) .await .unwrap(); - let public_key = Keypair::from(genesis_keypair).public(); - let genesis_peer_id = PeerId::from_public_key(&public_key); - let genesis_multiaddr = default_multiaddr(genesis_port, genesis_peer_id); + let public_key = Keypair::from(v36_keypair).public(); + let v36_peer_id = PeerId::from_public_key(&public_key); + let v36_multiaddr = default_multiaddr(v36_port, v36_peer_id); - // Starting a genesis validator node. - // It will connect to the genesis node and sync blocks. + // Starting a v36 validator node. + // It will connect to the v36 node and sync blocks. let latest_keypair = SecpKeypair::generate(); let hexed_secret = hex::encode(latest_keypair.secret().to_bytes()); - let validator_node = GenesisFuelCoreDriver::spawn(&[ + let validator_node = Version36FuelCoreDriver::spawn(&[ "--service-name", - "GenesisValidator", + "V36Validator", "--debug", "--poa-instant", "false", @@ -84,7 +84,7 @@ async fn latest_state_transition_function_is_forward_compatible_with_genesis_bin "--keypair", hexed_secret.as_str(), "--reserved-nodes", - genesis_multiaddr.as_str(), + v36_multiaddr.as_str(), "--peering-port", "0", ]) @@ -94,7 +94,7 @@ async fn latest_state_transition_function_is_forward_compatible_with_genesis_bin // Given let mut imported_blocks = validator_node.node.shared.block_importer.events(); const BLOCKS_TO_PRODUCE: u32 = 10; - genesis_node + v36_node .client .produce_blocks(BLOCKS_TO_PRODUCE, None) .await @@ -144,7 +144,7 @@ async fn latest_state_transition_function_is_forward_compatible_with_genesis_bin // Then let mut imported_blocks = validator_node.node.shared.block_importer.events(); - genesis_node + v36_node .client .produce_blocks(BLOCKS_TO_PRODUCE, None) .await diff --git a/version-compatibility/forkless-upgrade/src/lib.rs b/version-compatibility/forkless-upgrade/src/lib.rs index 27583513f45..b40ca55c722 100644 --- a/version-compatibility/forkless-upgrade/src/lib.rs +++ b/version-compatibility/forkless-upgrade/src/lib.rs @@ -3,11 +3,8 @@ #[cfg(test)] mod backward_compatibility; -// TODO: Uncomment forward compatibility tests after release of the `fuel-core 0.36.0`. -// New forward compatibility test should use the `fuel-core 0.36.0`. -// https://github.com/FuelLabs/fuel-core/issues/2198 -// #[cfg(test)] -// mod forward_compatibility; +#[cfg(test)] +mod forward_compatibility; #[cfg(test)] pub(crate) mod tests_helper; diff --git a/version-compatibility/forkless-upgrade/src/tests_helper.rs b/version-compatibility/forkless-upgrade/src/tests_helper.rs index 617b7403204..c48a1b512a1 100644 --- a/version-compatibility/forkless-upgrade/src/tests_helper.rs +++ b/version-compatibility/forkless-upgrade/src/tests_helper.rs @@ -26,6 +26,9 @@ use rand::{ Rng, }; use std::str::FromStr; +use version_36_fuel_core_bin::FuelService as Version36FuelService; +use version_36_fuel_core_client::client::FuelClient as Version36Client; +use version_36_fuel_core_services as _; // Awful version compatibility hack. // `$bin_crate::cli::run::get_service` is async in the later versions of fuel-core-bin. @@ -92,6 +95,14 @@ define_core_driver!( false ); +define_core_driver!( + version_36_fuel_core_bin, + Version36FuelService, + Version36Client, + Version36FuelCoreDriver, + true +); + define_core_driver!( latest_fuel_core_bin, LatestFuelService, @@ -101,6 +112,7 @@ define_core_driver!( ); pub const IGNITION_TESTNET_SNAPSHOT: &str = "./chain-configurations/ignition"; +pub const V36_TESTNET_SNAPSHOT: &str = "./chain-configurations/v36"; pub const POA_SECRET_KEY: &str = "e3d6eb39607650e22f0befa26d52e921d2e7924d0e165f38ffa8d9d0ac73de93"; pub const PRIVILEGED_ADDRESS_KEY: &str =