Skip to content

Commit

Permalink
updated estimate test values and mainnet constants for paris
Browse files Browse the repository at this point in the history
  • Loading branch information
dsawali committed Jun 5, 2024
1 parent 9bda597 commit 9d1cec1
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 45 deletions.
12 changes: 6 additions & 6 deletions integration-tests/__tests__/contract/estimation-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
it('Verify .estimate.transfer for internal transfer to allocated implicit', async () => {
const tx = contract.methods.do(MANAGER_LAMBDA.transferImplicit(knownBaker, 5)).toTransferParams();
const estimate = await LowAmountTez.estimate.transfer(tx);
expect(estimate.gasLimit).toEqual(1456);
expect(estimate.gasLimit).toEqual(1457);
expect(estimate.storageLimit).toEqual(0);
expect(estimate.suggestedFeeMutez).toEqual(394);
expect(estimate.burnFeeMutez).toEqual(0);
expect(estimate.minimalFeeMutez).toEqual(374);
expect(estimate.totalCost).toEqual(374);
expect(estimate.usingBaseFeeMutez).toEqual(374);
expect(estimate.consumedMilligas).toEqual(1455798);
expect(estimate.consumedMilligas).toEqual(1456056);
});

it('Verify .estimate.transfer for multiple internal transfers to unallocated account', async () => {
Expand All @@ -117,9 +117,9 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.suggestedFeeMutez).toEqual(465);
expect(estimate.burnFeeMutez).toEqual(133500);
expect(estimate.minimalFeeMutez).toEqual(445);
expect(estimate.totalCost).toEqual(133945);
expect(estimate.totalCost).toEqual((133945));
expect(estimate.usingBaseFeeMutez).toEqual(445);
expect(estimate.consumedMilligas).toEqual(1570327);
expect(estimate.consumedMilligas).toEqual(1570585);
});

it('Verify .estimate.transfer for internal origination', async () => {
Expand All @@ -132,7 +132,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(421);
expect(estimate.totalCost).toEqual(84671);
expect(estimate.usingBaseFeeMutez).toEqual(421);
expect(estimate.consumedMilligas).toEqual(1866422);
expect(estimate.consumedMilligas).toEqual(1866680);
});

it('Verify .estimate.transfer for multiple internal originations', async () => {
Expand All @@ -145,7 +145,7 @@ CONFIGS().forEach(({ lib, setup, knownBaker, createAddress, rpc }) => {
expect(estimate.minimalFeeMutez).toEqual(539);
expect(estimate.totalCost).toEqual(164039);
expect(estimate.usingBaseFeeMutez).toEqual(539);
expect(estimate.consumedMilligas).toEqual(2391575);
expect(estimate.consumedMilligas).toEqual(2391833);
// Do the actual operation
const op2 = await contract.methods.do(originate2()).send();
await op2.confirmation();
Expand Down
95 changes: 56 additions & 39 deletions integration-tests/__tests__/rpc/get-protocol-constants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
describe('Test fetching constants for all protocols on Mainnet', () => {
const rpcUrl = 'https://mainnet.ecadinfra.com/';
Tezos.setRpcProvider(rpcUrl);
it(`should successfully fetch Proto19(oxford2) constants at head`, async () => {
const constants: ConstantsResponseProto019 = await Tezos.rpc.getConstants();
it(`should successfully fetch Proto20(Paris) constants at head`, async () => {
const constants: ConstantsResponseProto020 = await Tezos.rpc.getConstants();
expect(constants).toEqual({
adaptive_issuance_activation_vote_enable: false,
adaptive_issuance_launch_ema_threshold: 1600000000,
adaptive_issuance_activation_vote_enable: true,
adaptive_issuance_force_activation: false,
adaptive_issuance_launch_ema_threshold: 0,
adaptive_rewards_params: {
center_dz: {
denominator: "2",
Expand All @@ -24,19 +25,29 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
denominator: "100",
numerator: "1",
},
issuance_ratio_max: {
denominator: "20",
issuance_ratio_final_max: {
denominator: "10",
numerator: "1",
},
issuance_ratio_min: {
denominator: "2000",
issuance_ratio_final_min: {
denominator: "400",
numerator: "1",
},
issuance_ratio_initial_max: {
denominator: "200",
numerator: "11",
},
issuance_ratio_initial_min: {
denominator: "200",
numerator: "9"
},
max_bonus: "50000000000000",
radius_dz: {
denominator: "50",
numerator: "1",
},
initial_period: 10,
transition_period: 50
},
autostaking_enable: true,
proof_of_work_nonce_size: 8,
Expand All @@ -47,43 +58,48 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
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_max_number_of_messages_per_level: '1000000',
preserved_cycles: 5,
blocks_per_cycle: 16384,
blocks_per_commitment: 128,
nonce_revelation_threshold: 512,
blocks_per_stake_snapshot: 1024,
blocks_per_commitment: 192,
blocks_per_cycle: 24576,
blocks_preservation_cycles: 1,
nonce_revelation_threshold: 768,
cache_layout_size: 3,
consensus_rights_delay: 2,
cost_per_byte: new BigNumber(250),
cycles_per_voting_period: 5,
delay_increment_per_round: new BigNumber(5),
delegate_parameters_activation_delay: 5,
direct_ticket_spending_enable: false,
hard_gas_limit_per_operation: new BigNumber(1040000),
hard_gas_limit_per_block: new BigNumber(2600000),
hard_gas_limit_per_block: new BigNumber(1733333),
proof_of_work_threshold: new BigNumber(281474976710655),
minimal_stake: new BigNumber(6000000000),
origination_size: 257,
cost_per_byte: new BigNumber(250),
hard_storage_limit_per_operation: new BigNumber(60000),
percentage_of_frozen_deposits_slashed_per_double_baking: 5,
percentage_of_frozen_deposits_slashed_per_double_attestation: 50,
percentage_of_frozen_deposits_slashed_per_double_attestation: 5000,
percentage_of_frozen_deposits_slashed_per_double_baking: 500,
minimal_frozen_stake: '600000000',
limit_of_delegation_over_baking: 9,
issuance_weights: {
attesting_reward_weight: 10240,
base_total_issued_per_minute: "80007812",
baking_reward_bonus_weight: 5120,
baking_reward_fixed_portion_weight: 5120,
base_total_issued_per_minute: "85007812",
liquidity_baking_subsidy_weight: 1280,
seed_nonce_revelation_tip_weight: 1,
vdf_revelation_tip_weight: 1,
},
min_proposal_quorum: 500,
edge_of_staking_over_delegation: 2,
global_limit_of_staking_over_baking: 5,
liquidity_baking_toggle_ema_threshold: 1000000000,
max_operations_time_to_live: 240,
minimal_block_delay: new BigNumber(15),
delay_increment_per_round: new BigNumber(8),
liquidity_baking_subsidy: new BigNumber(5000000),
max_operations_time_to_live: 360,
max_slashing_per_block: 10000,
max_slashing_threshold: 2334,
minimal_block_delay: new BigNumber(10),
ns_enable: true,
consensus_committee_size: 7000,
consensus_threshold: 4667,
minimal_participation_ratio: {
Expand All @@ -95,23 +111,23 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
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: 1,
redundancy_factor: 16,
page_size: 4096,
slot_size: 1048576,
number_of_shards: 2048
attestation_lag: 8,
attestation_threshold: 66,
feature_enable: true,
incentives_enable: false,
number_of_shards: 512,
number_of_slots: 32,
page_size: 3967,
redundancy_factor: 8,
slot_size: 126944,
},
quorum_max: 7000,
quorum_min: 2000,
smart_rollup_arith_pvm_enable: false,
smart_rollup_challenge_window_in_blocks: 80640,
smart_rollup_commitment_period_in_blocks: 60,
smart_rollup_max_lookahead_in_blocks: 172800,
smart_rollup_max_active_outbox_levels: 80640,
smart_rollup_challenge_window_in_blocks: 120960,
smart_rollup_commitment_period_in_blocks: 90,
smart_rollup_max_lookahead_in_blocks: 259200,
smart_rollup_max_active_outbox_levels: 120960,
smart_rollup_max_outbox_messages_per_level: 100,
smart_rollup_max_number_of_cemented_commitments: 5,
smart_rollup_max_number_of_parallel_games: 32,
Expand All @@ -120,16 +136,17 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
smart_rollup_origination_size: 6314,
smart_rollup_private_enable: true,
smart_rollup_reveal_activation_level: {
dal_page: 2147483646,
dal_parameters: 2147483646,
dal_attested_slots_validity_lag: 241920,
dal_page: 5726209,
dal_parameters: 5726209,
metadata: 0,
raw_data: {
Blake2B: 0,
},
},
smart_rollup_riscv_pvm_enable: false,
smart_rollup_stake_amount: '10000000000',
smart_rollup_timeout_period_in_blocks: 40320,
smart_rollup_timeout_period_in_blocks: 60480,
vdf_difficulty: new BigNumber(8000000000),
zk_rollup_enable: false,
zk_rollup_max_ticket_payload_size: 2048,
Expand Down

0 comments on commit 9d1cec1

Please sign in to comment.