diff --git a/contrib/kaitai-struct-files/files/alpha__constants.ksy b/contrib/kaitai-struct-files/files/alpha__constants.ksy index 2c9b1e99d6193675361e3b06841494418dce212d..75cfeb9ea02b025a2283cfa06dc7987f8115a128 100644 --- a/contrib/kaitai-struct-files/files/alpha__constants.ksy +++ b/contrib/kaitai-struct-files/files/alpha__constants.ksy @@ -32,6 +32,9 @@ types: - id: feature_enable type: u1 enum: bool + - id: incentives_enable + type: u1 + enum: bool - id: number_of_slots type: s2 - id: attestation_lag diff --git a/contrib/kaitai-struct-files/files/alpha__constants__parametric.ksy b/contrib/kaitai-struct-files/files/alpha__constants__parametric.ksy index abe90ad71d20a4742840e96aa30f51966a166efd..7a9cdc7f284f4ab6f0b7bf04bb49ad8343985bc1 100644 --- a/contrib/kaitai-struct-files/files/alpha__constants__parametric.ksy +++ b/contrib/kaitai-struct-files/files/alpha__constants__parametric.ksy @@ -32,6 +32,9 @@ types: - id: feature_enable type: u1 enum: bool + - id: incentives_enable + type: u1 + enum: bool - id: number_of_slots type: s2 - id: attestation_lag diff --git a/contrib/kaitai-struct-files/files/alpha__parameters.ksy b/contrib/kaitai-struct-files/files/alpha__parameters.ksy index bdc59b805a745a52cd3b2e0ad044aeb7cb3b7271..0bc137163152aca0596babdf62fc8b784bfcf684 100644 --- a/contrib/kaitai-struct-files/files/alpha__parameters.ksy +++ b/contrib/kaitai-struct-files/files/alpha__parameters.ksy @@ -166,6 +166,9 @@ types: - id: feature_enable type: u1 enum: bool + - id: incentives_enable + type: u1 + enum: bool - id: number_of_slots type: s2 - id: attestation_lag diff --git a/src/lib_dal_node/dal_plugin.ml b/src/lib_dal_node/dal_plugin.ml index 70bec7eefdb1ace48bf9e2c5442b1d0860875d5c..1ab059ffb79c31447e4b3ea9321bddc869504dc9 100644 --- a/src/lib_dal_node/dal_plugin.ml +++ b/src/lib_dal_node/dal_plugin.ml @@ -35,6 +35,7 @@ type slot_header = { type proto_parameters = { feature_enable : bool; + incentives_enable : bool; number_of_slots : int; attestation_lag : int; attestation_threshold : int; diff --git a/src/lib_dal_node/dal_plugin.mli b/src/lib_dal_node/dal_plugin.mli index c5546ffe97e14a49e24f10390d653632d5c37e46..6d829a1855ffca48075f58343f74de3802a9449a 100644 --- a/src/lib_dal_node/dal_plugin.mli +++ b/src/lib_dal_node/dal_plugin.mli @@ -44,6 +44,7 @@ type slot_header = { type proto_parameters = { feature_enable : bool; + incentives_enable : bool; number_of_slots : int; attestation_lag : int; attestation_threshold : int; diff --git a/src/proto_017_PtNairob/lib_dal/dal_plugin_registration.ml b/src/proto_017_PtNairob/lib_dal/dal_plugin_registration.ml index 438fbba5658c60b40371f4805d2e89665825e648..21dea0d9d84e85da804cfc765dae2adb1cbc5b31 100644 --- a/src/proto_017_PtNairob/lib_dal/dal_plugin_registration.ml +++ b/src/proto_017_PtNairob/lib_dal/dal_plugin_registration.ml @@ -51,6 +51,7 @@ module Plugin = struct return { Dal_plugin.feature_enable; + incentives_enable = false; number_of_slots; attestation_lag; attestation_threshold; diff --git a/src/proto_018_Proxford/lib_dal/dal_plugin_registration.ml b/src/proto_018_Proxford/lib_dal/dal_plugin_registration.ml index 12e8c8687245f593bd116672627c2608ee535e3f..37dbff2cf5c7b0aa6dd1ecc6df244fac3a0bd186 100644 --- a/src/proto_018_Proxford/lib_dal/dal_plugin_registration.ml +++ b/src/proto_018_Proxford/lib_dal/dal_plugin_registration.ml @@ -51,6 +51,7 @@ module Plugin = struct return { Dal_plugin.feature_enable; + incentives_enable = false; number_of_slots; attestation_lag; attestation_threshold; diff --git a/src/proto_alpha/lib_dal/dal_plugin_registration.ml b/src/proto_alpha/lib_dal/dal_plugin_registration.ml index 12e8c8687245f593bd116672627c2608ee535e3f..c49299b0b457a5d3f55d4ba76b62219b7a4ff964 100644 --- a/src/proto_alpha/lib_dal/dal_plugin_registration.ml +++ b/src/proto_alpha/lib_dal/dal_plugin_registration.ml @@ -40,6 +40,7 @@ module Plugin = struct let* parametric = parametric_constants chain block ctxt in let { Constants.Parametric.feature_enable; + incentives_enable; number_of_slots; attestation_lag; attestation_threshold; @@ -51,6 +52,7 @@ module Plugin = struct return { Dal_plugin.feature_enable; + incentives_enable; number_of_slots; attestation_lag; attestation_threshold; diff --git a/src/proto_alpha/lib_parameters/default_parameters.ml b/src/proto_alpha/lib_parameters/default_parameters.ml index 8391e4d69b5eea66ee872becc211aa3a94ad0cdc..9c9ef545f9cba42561a612e11fc34f76bbb33791 100644 --- a/src/proto_alpha/lib_parameters/default_parameters.ml +++ b/src/proto_alpha/lib_parameters/default_parameters.ml @@ -140,6 +140,7 @@ let default_dal = Constants.Parametric. { feature_enable = false; + incentives_enable = false; number_of_slots = 256; attestation_lag = 4; attestation_threshold = 50; diff --git a/src/proto_alpha/lib_protocol/alpha_context.mli b/src/proto_alpha/lib_protocol/alpha_context.mli index 4d4672b7d252bdfceb9e75daccaa7a2e08c99a5b..9345ee7cc1b3ea5ee423d70824ae3a95e156e7b0 100644 --- a/src/proto_alpha/lib_protocol/alpha_context.mli +++ b/src/proto_alpha/lib_protocol/alpha_context.mli @@ -810,6 +810,7 @@ module Constants : sig module Parametric : sig type dal = { feature_enable : bool; + incentives_enable : bool; number_of_slots : int; attestation_lag : int; attestation_threshold : int; diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml index 87b83b6a73d51e3fb69cd06b49818215940e2aae..c6e5a5ab93454f0cc5bdf6f17abb1bd2e042de74 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.ml +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.ml @@ -27,6 +27,7 @@ type dal = { feature_enable : bool; + incentives_enable : bool; number_of_slots : int; attestation_lag : int; attestation_threshold : int; @@ -39,6 +40,7 @@ let dal_encoding = conv (fun { feature_enable; + incentives_enable; number_of_slots; attestation_lag; attestation_threshold; @@ -46,12 +48,14 @@ let dal_encoding = blocks_per_epoch; } -> ( ( feature_enable, + incentives_enable, number_of_slots, attestation_lag, attestation_threshold, blocks_per_epoch ), cryptobox_parameters )) (fun ( ( feature_enable, + incentives_enable, number_of_slots, attestation_lag, attestation_threshold, @@ -59,6 +63,7 @@ let dal_encoding = cryptobox_parameters ) -> { feature_enable; + incentives_enable; number_of_slots; attestation_lag; attestation_threshold; @@ -66,8 +71,9 @@ let dal_encoding = cryptobox_parameters; }) (merge_objs - (obj5 + (obj6 (req "feature_enable" bool) + (req "incentives_enable" bool) (req "number_of_slots" int16) (req "attestation_lag" int16) (req "attestation_threshold" int16) diff --git a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli index bddbfa855d83e10f1439627de824ea2779d5ea60..4533c37e2fe3c74b1372e61d6196ec76ad40c390 100644 --- a/src/proto_alpha/lib_protocol/constants_parametric_repr.mli +++ b/src/proto_alpha/lib_protocol/constants_parametric_repr.mli @@ -27,6 +27,7 @@ type dal = { feature_enable : bool; + incentives_enable : bool; number_of_slots : int; attestation_lag : int; attestation_threshold : int; diff --git a/src/proto_alpha/lib_protocol/raw_context.ml b/src/proto_alpha/lib_protocol/raw_context.ml index fc3395c759a1660554532eb08fe4cad0da51a63c..58fd927a9289964a50cf9c4c924c3149af435e4e 100644 --- a/src/proto_alpha/lib_protocol/raw_context.ml +++ b/src/proto_alpha/lib_protocol/raw_context.ml @@ -1038,6 +1038,7 @@ let prepare_first_block ~level ~timestamp _chain_id ctxt = Constants_parametric_repr. { feature_enable = c.dal.feature_enable; + incentives_enable = false; number_of_slots = c.dal.number_of_slots; attestation_lag = c.dal.attestation_lag; attestation_threshold = c.dal.attestation_threshold; diff --git a/tezt/lib_tezos/dal_common.ml b/tezt/lib_tezos/dal_common.ml index 082b5381823029aaee5eaf7855eb80b02025edc6..9dbe9ee46886f23c023eb372266703845eff5424 100644 --- a/tezt/lib_tezos/dal_common.ml +++ b/tezt/lib_tezos/dal_common.ml @@ -29,6 +29,7 @@ module Cryptobox = Tezos_crypto_dal.Cryptobox module Parameters = struct type t = { feature_enabled : bool; + incentives_enabled : bool; cryptobox : Cryptobox.parameters; number_of_slots : int; attestation_lag : int; @@ -53,8 +54,13 @@ module Parameters = struct in let blocks_per_epoch = JSON.(json |-> "blocks_per_epoch" |> as_int) in let feature_enabled = JSON.(json |-> "feature_enable" |> as_bool) in + let incentives_enabled = + JSON.(json |-> "incentives_enable" |> as_bool_opt) + |> Option.value ~default:false + in { feature_enabled; + incentives_enabled; cryptobox = Cryptobox.Verifier. {number_of_shards; redundancy_factor; slot_size; page_size}; diff --git a/tezt/lib_tezos/dal_common.mli b/tezt/lib_tezos/dal_common.mli index e5e5016171f264e2bd5c16c81aaacbf746993978..165a48b85265ec94df68f9b1d53392113e785f97 100644 --- a/tezt/lib_tezos/dal_common.mli +++ b/tezt/lib_tezos/dal_common.mli @@ -29,6 +29,7 @@ module Cryptobox = Tezos_crypto_dal.Cryptobox module Parameters : sig type t = { feature_enabled : bool; + incentives_enabled : bool; cryptobox : Cryptobox.parameters; number_of_slots : int; attestation_lag : int; diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out index a20f0c53dcd66c4b784dedcf54740de25393a35d..d55ecea3bf29777959fa22297a1611741c5ae919 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode client) RPC regression tests- misc_protocol.out @@ -37,7 +37,8 @@ "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, "dal_parametric": - { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 4, + { "feature_enable": false, "incentives_enable": false, + "number_of_slots": 16, "attestation_lag": 4, "attestation_threshold": 50, "blocks_per_epoch": 1, "redundancy_factor": 8, "page_size": 128, "slot_size": 32768, "number_of_shards": 64 }, "smart_rollup_arith_pvm_enable": false, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out index 0951e336ff0d262ee1caa242ffdbc8d64ac2ec52..08e4088fc65097d633f47731516b3eb8e557a479 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode light) RPC regression tests- misc_protocol.out @@ -37,7 +37,8 @@ "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, "dal_parametric": - { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 4, + { "feature_enable": false, "incentives_enable": false, + "number_of_slots": 16, "attestation_lag": 4, "attestation_threshold": 50, "blocks_per_epoch": 1, "redundancy_factor": 8, "page_size": 128, "slot_size": 32768, "number_of_shards": 64 }, "smart_rollup_arith_pvm_enable": false, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out index 793d37798206b265b1444549f3e0ddfe9bd44927..2d256be68aa0ca86f81ccd6ba89dd2385f7f5ca1 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy) RPC regression tests- misc_protocol.out @@ -37,7 +37,8 @@ "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, "dal_parametric": - { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 4, + { "feature_enable": false, "incentives_enable": false, + "number_of_slots": 16, "attestation_lag": 4, "attestation_threshold": 50, "blocks_per_epoch": 1, "redundancy_factor": 8, "page_size": 128, "slot_size": 32768, "number_of_shards": 64 }, "smart_rollup_arith_pvm_enable": false, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out index 4c760b0af97f198d203ff28c997e85ae70768dd1..da9e47d1ee684cc4f019c542a50981eb52435ec5 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_data_dir) RPC regression tests- misc_protocol.out @@ -37,7 +37,8 @@ "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, "dal_parametric": - { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 4, + { "feature_enable": false, "incentives_enable": false, + "number_of_slots": 16, "attestation_lag": 4, "attestation_threshold": 50, "blocks_per_epoch": 1, "redundancy_factor": 8, "page_size": 128, "slot_size": 32768, "number_of_shards": 64 }, "smart_rollup_arith_pvm_enable": false, diff --git a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out index 4c760b0af97f198d203ff28c997e85ae70768dd1..da9e47d1ee684cc4f019c542a50981eb52435ec5 100644 --- a/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out +++ b/tezt/tests/expected/RPC_test.ml/Alpha- (mode proxy_server_rpc) RPC regression tests- misc_protocol.out @@ -37,7 +37,8 @@ "cache_script_size": 100000000, "cache_stake_distribution_cycles": 8, "cache_sampler_state_cycles": 8, "dal_parametric": - { "feature_enable": false, "number_of_slots": 16, "attestation_lag": 4, + { "feature_enable": false, "incentives_enable": false, + "number_of_slots": 16, "attestation_lag": 4, "attestation_threshold": 50, "blocks_per_epoch": 1, "redundancy_factor": 8, "page_size": 128, "slot_size": 32768, "number_of_shards": 64 }, "smart_rollup_arith_pvm_enable": false,