Skip to content

Commit

Permalink
test: updated protocol constants test with oxfordnet
Browse files Browse the repository at this point in the history
  • Loading branch information
hui-an-yang committed Sep 5, 2023
1 parent 92f9d6b commit 9b57e12
Showing 1 changed file with 164 additions and 39 deletions.
203 changes: 164 additions & 39 deletions integration-tests/rpc-get-protocol-constants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {

CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
const Tezos = lib;
const oxfordnet = (networkType == NetworkType.TESTNET && protocol === Protocols.Proxford) ? test : test.skip;
const alpha = (networkType == NetworkType.TESTNET && protocol === Protocols.ProtoALpha) ? test : test.skip;

describe('Test fetching constants for all protocols on Mainnet', () => {
Expand Down Expand Up @@ -763,22 +764,22 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
cache_script_size: 100000000,
cache_stake_distribution_cycles: 8,
cycles_per_voting_period: 5,
smart_rollup_arith_pvm_enable : false,
smart_rollup_challenge_window_in_blocks : 80640,
smart_rollup_commitment_period_in_blocks : 60,
smart_rollup_enable : true,
smart_rollup_max_active_outbox_levels : 80640,
smart_rollup_max_lookahead_in_blocks : 172800,
smart_rollup_max_number_of_cemented_commitments : 5,
smart_rollup_max_number_of_messages_per_level : "1000000",
smart_rollup_max_number_of_parallel_games : 32,
smart_rollup_max_outbox_messages_per_level : 100,
smart_rollup_max_wrapped_proof_binary_size : 30000,
smart_rollup_message_size_limit : 4096,
smart_rollup_number_of_sections_in_dissection : 32,
smart_rollup_origination_size : 6314,
smart_rollup_stake_amount : "10000000000",
smart_rollup_timeout_period_in_blocks : 40320,
smart_rollup_arith_pvm_enable: false,
smart_rollup_challenge_window_in_blocks: 80640,
smart_rollup_commitment_period_in_blocks: 60,
smart_rollup_enable: true,
smart_rollup_max_active_outbox_levels: 80640,
smart_rollup_max_lookahead_in_blocks: 172800,
smart_rollup_max_number_of_cemented_commitments: 5,
smart_rollup_max_number_of_messages_per_level: "1000000",
smart_rollup_max_number_of_parallel_games: 32,
smart_rollup_max_outbox_messages_per_level: 100,
smart_rollup_max_wrapped_proof_binary_size: 30000,
smart_rollup_message_size_limit: 4096,
smart_rollup_number_of_sections_in_dissection: 32,
smart_rollup_origination_size: 6314,
smart_rollup_stake_amount: "10000000000",
smart_rollup_timeout_period_in_blocks: 40320,
tx_rollup_commitment_bond: new BigNumber(10000000000),
tx_rollup_cost_per_byte_ema_factor: 120,
tx_rollup_enable: false,
Expand All @@ -803,13 +804,8 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
done();
});


});

describe(`Fetch constants for testnet`, () => {
it(`successfully fetches all constants for nairobinet using ${rpc}`, async (done) => {
Tezos.setRpcProvider(rpc);
const constants: ConstantsResponseProto017 = await Tezos.rpc.getConstants();
it(`successfully fetches Proto17 constants at level 4178617`, async (done) => {
const constants: ConstantsResponseProto017 = await Tezos.rpc.getConstants({ block: '4178617' });

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
Expand All @@ -825,32 +821,32 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
smart_rollup_max_wrapped_proof_binary_size: 30000,
smart_rollup_message_size_limit: 4096,
smart_rollup_max_number_of_messages_per_level: '1000000',
preserved_cycles: 3,
blocks_per_cycle: 8192,
blocks_per_commitment: 64,
preserved_cycles: 5,
blocks_per_cycle: 16384,
blocks_per_commitment: 128,
nonce_revelation_threshold: 512,
blocks_per_stake_snapshot: 512,
cycles_per_voting_period: 1,
blocks_per_stake_snapshot: 1024,
cycles_per_voting_period: 5,
hard_gas_limit_per_operation: new BigNumber(1040000),
hard_gas_limit_per_block: new BigNumber(2600000),
proof_of_work_threshold: new BigNumber(-1),
proof_of_work_threshold: new BigNumber(281474976710655),
minimal_stake: new BigNumber(6000000000),
vdf_difficulty: new BigNumber(10000000000),
vdf_difficulty: new BigNumber(8000000000),
seed_nonce_revelation_tip: new BigNumber(125000),
origination_size: 257,
baking_reward_fixed_portion: new BigNumber(2666666),
baking_reward_bonus_per_slot: new BigNumber(1143),
endorsing_reward_per_slot: new BigNumber(761),
baking_reward_fixed_portion: new BigNumber(5000000),
baking_reward_bonus_per_slot: new BigNumber(2143),
endorsing_reward_per_slot: new BigNumber(1428),
cost_per_byte: new BigNumber(250),
hard_storage_limit_per_operation: new BigNumber(60000),
quorum_min: 2000,
quorum_max: 7000,
min_proposal_quorum: 500,
liquidity_baking_subsidy: new BigNumber(666666),
liquidity_baking_subsidy: new BigNumber(1250000),
liquidity_baking_toggle_ema_threshold: 1000000000,
max_operations_time_to_live: 240,
minimal_block_delay: new BigNumber(8),
delay_increment_per_round: new BigNumber(3),
minimal_block_delay: new BigNumber(15),
delay_increment_per_round: new BigNumber(8),
consensus_committee_size: 7000,
consensus_threshold: 4667,
minimal_participation_ratio: {
Expand All @@ -864,7 +860,6 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
numerator: 1,
denominator: 2
},
testnet_dictator: 'tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8',
cache_script_size: 100000000,
cache_stake_distribution_cycles: 8,
cache_sampler_state_cycles: 8,
Expand All @@ -882,7 +877,7 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
tx_rollup_cost_per_byte_ema_factor: 120,
tx_rollup_max_ticket_payload_size: 2048,
tx_rollup_rejection_max_proof_size: 30000,
tx_rollup_sunset_level: 10000000,
tx_rollup_sunset_level: 3473409,
dal_parametric: {
feature_enable: false,
number_of_slots: 256,
Expand All @@ -897,6 +892,103 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
smart_rollup_enable: true,
smart_rollup_arith_pvm_enable: false,
smart_rollup_origination_size: 6314,
smart_rollup_challenge_window_in_blocks: 80640,
smart_rollup_stake_amount: '10000000000',
smart_rollup_commitment_period_in_blocks: 60,
smart_rollup_max_lookahead_in_blocks: 172800,
smart_rollup_max_active_outbox_levels: 80640,
smart_rollup_max_outbox_messages_per_level: 100,
smart_rollup_number_of_sections_in_dissection: 32,
smart_rollup_timeout_period_in_blocks: 40320,
smart_rollup_max_number_of_cemented_commitments: 5,
smart_rollup_max_number_of_parallel_games: 32,
zk_rollup_enable: false,
zk_rollup_origination_size: 4000,
zk_rollup_min_pending_to_process: 10
});

done();
})

});
describe(`Fetch constants for testnet`, () => {
oxfordnet(`successfully fetches all constants for oxford using ${rpc}`, async (done) => {
Tezos.setRpcProvider(rpc);
const constants = await Tezos.rpc.getConstants();

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
nonce_length: 32,
max_anon_ops_per_block: 132,
max_operation_data_length: 32768,
max_proposals_per_delegate: 20,
max_micheline_node_count: 50000,
max_micheline_bytes_limit: 50000,
max_allowed_global_constants_depth: 10000,
cache_layout_size: 3,
michelson_maximum_type_size: 2001,
smart_rollup_max_wrapped_proof_binary_size: 30000,
smart_rollup_message_size_limit: 4096,
smart_rollup_max_number_of_messages_per_level: '1000000',
preserved_cycles: 3,
blocks_per_cycle: 8192,
blocks_per_commitment: 64,
nonce_revelation_threshold: 512,
blocks_per_stake_snapshot: 512,
cycles_per_voting_period: 1,
hard_gas_limit_per_operation: new BigNumber(1040000),
hard_gas_limit_per_block: new BigNumber(2600000),
proof_of_work_threshold: new BigNumber(-1),
minimal_stake: new BigNumber(6000000000),
minimal_frozen_stake: '600000000',
vdf_difficulty: new BigNumber(10000000000),
origination_size: 257,
issuance_weights: {
base_total_issued_per_minute: '85007812',
baking_reward_fixed_portion_weight: 5120,
baking_reward_bonus_weight: 5120,
attesting_reward_weight: 10240,
liquidity_baking_subsidy_weight: 1280,
seed_nonce_revelation_tip_weight: 1,
vdf_revelation_tip_weight: 1,
},
cost_per_byte: new BigNumber(250),
hard_storage_limit_per_operation: new BigNumber(60000),
quorum_min: 2000,
quorum_max: 7000,
min_proposal_quorum: 500,
liquidity_baking_toggle_ema_threshold: 1000000000,
max_operations_time_to_live: 240,
minimal_block_delay: new BigNumber(8),
delay_increment_per_round: new BigNumber(3),
consensus_committee_size: 7000,
consensus_threshold: 4667,
minimal_participation_ratio: {
numerator: 2,
denominator: 3
},
max_slashing_period: 2,
limit_of_delegation_over_baking: 9,
percentage_of_frozen_deposits_slashed_per_double_baking: 10,
percentage_of_frozen_deposits_slashed_per_double_attestation: 50,
testnet_dictator: "tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8",
cache_script_size: 100000000,
cache_stake_distribution_cycles: 8,
cache_sampler_state_cycles: 8,
dal_parametric: {
feature_enable: false,
number_of_slots: 256,
attestation_lag: 4,
attestation_threshold: 50,
blocks_per_epoch: 8,
redundancy_factor: 16,
page_size: 4096,
slot_size: 1048576,
number_of_shards: 2048
},
smart_rollup_enable: true,
smart_rollup_arith_pvm_enable: false,
smart_rollup_origination_size: 6314,
smart_rollup_challenge_window_in_blocks: 40,
smart_rollup_stake_amount: '10000000000',
smart_rollup_commitment_period_in_blocks: 20,
Expand All @@ -907,9 +999,42 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
smart_rollup_timeout_period_in_blocks: 500,
smart_rollup_max_number_of_cemented_commitments: 5,
smart_rollup_max_number_of_parallel_games: 32,
smart_rollup_reveal_activation_level: {
dal_page: 2147483646,
metadata: 0,
raw_data: {
Blake2B: 0,
},
},
zk_rollup_enable: false,
zk_rollup_origination_size: 4000,
zk_rollup_min_pending_to_process: 10
zk_rollup_min_pending_to_process: 10,
zk_rollup_max_ticket_payload_size: 2048,
global_limit_of_staking_over_baking: 5,
edge_of_staking_over_delegation: 2,
adaptive_issuance_launch_ema_threshold: 100000000,
adaptive_rewards_params: {
issuance_ratio_min: {
numerator: '1',
denominator: '2000'
},
issuance_ratio_max: {
numerator: '1',
denominator: '20'
},
max_bonus: '50000000000000',
growth_rate: '115740740',
center_dz: {
numerator: '1',
denominator: '2'
},
radius_dz: {
numerator: '1',
denominator: '50'
}
}


});

done();
Expand Down

0 comments on commit 9b57e12

Please sign in to comment.