Skip to content

Commit

Permalink
Merge pull request casper-network#4663 from sacherjj/condor-chainspec…
Browse files Browse the repository at this point in the history
…-peregrin-sync

Syncing and cleanup of chainspec.toml values
  • Loading branch information
sacherjj authored Apr 11, 2024
2 parents b2b2fba + 3c769b1 commit 79d5865
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion resources/local/chainspec.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ strict_argument_checking = false
# Number of simultaneous peer requests.
simultaneous_peer_requests = 5
# The consensus protocol to use. Options are "Zug" and "Highway".
consensus_protocol = 'Highway'
consensus_protocol = 'Zug'
# The maximum amount of delegators per validator.
max_delegators_per_validator = 1200
# The split in finality signature rewards between block producer and participating signers.
Expand Down
56 changes: 38 additions & 18 deletions resources/production/chainspec.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,28 +135,28 @@ administrators = []

[highway]
# Highway dynamically chooses its round length, between minimum_block_time and maximum_round_length.
maximum_round_length = '132 seconds'
maximum_round_length = '66 seconds'
# The factor by which rewards for a round are multiplied if the greatest summit has ≤50% quorum, i.e. no finality.
# Expressed as a fraction (1/5 by default).
reduced_reward_multiplier = [1, 5]

[transactions]
# The duration after the transaction timestamp that it can be included in a block.
max_ttl = '18 hours'
max_ttl = '2 hours'
# Maximum transaction size in bytes. Size is of the transaction when serialized via ToBytes.
max_transaction_size = 1_048_576
# Maximum number of mint transactions (i.e. transfers) allowed in a block.
block_max_mint_count = 500
block_max_mint_count = 650
# Maximum number of auction (staking) transactions allowed in a block.
block_max_auction_count = 100
# Maximum number of installer/upgrader transactions allowed in a block.
block_max_install_upgrade_count = 2
# Maximum number of other transactions (non-transfer, non-staking, non-installer/upgrader) allowed in a block.
block_max_standard_count = 50
block_max_standard_count = 25
# The maximum number of approvals permitted in a single block.
block_max_approval_count = 2600
# Maximum block size in bytes including transactions contained by the block. 0 means unlimited.
max_block_size = 10_485_760
max_block_size = 5_242_880
# The upper limit of total gas of all transactions in a block.
block_gas_limit = 4_000_000_000_000
# The minimum amount in motes for a valid native transfer.
Expand Down Expand Up @@ -186,7 +186,7 @@ max_stack_height = 500

[wasm.storage_costs]
# Gas charged per byte stored in the global state.
gas_per_byte = 630_000
gas_per_byte = 1_117_587

[wasm.opcode_costs]
# Bit operations multiplier.
Expand Down Expand Up @@ -244,21 +244,21 @@ size_multiplier = 100
# Host function declarations are located in smart_contracts/contract/src/ext_ffi.rs
[wasm.host_function_costs]
add = { cost = 5_800, arguments = [0, 0, 0, 0] }
add_associated_key = { cost = 9_000, arguments = [0, 0, 0] }
add_contract_version = { cost = 200, arguments = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }
blake2b = { cost = 200, arguments = [0, 0, 0, 0] }
call_contract = { cost = 4_500, arguments = [0, 0, 0, 0, 0, 420, 0] }
call_versioned_contract = { cost = 4_500, arguments = [0, 0, 0, 0, 0, 0, 0, 420, 0] }
add_associated_key = { cost = 1_200_000, arguments = [0, 0, 0] }
add_contract_version = { cost = 200, arguments = [0, 0, 0, 0, 120_000, 0, 0, 0, 0, 0, 0] }
blake2b = { cost = 1_200_000, arguments = [0, 120_000, 0, 0] }
call_contract = { cost = 300_000_000, arguments = [0, 0, 0, 120_000, 0, 120_000, 0] }
call_versioned_contract = { cost = 300_000_000, arguments = [0, 0, 0, 0, 0, 120_000, 0, 120_000, 0] }
create_contract_package_at_hash = { cost = 200, arguments = [0, 0] }
create_contract_user_group = { cost = 200, arguments = [0, 0, 0, 0, 0, 0, 0, 0] }
create_purse = { cost = 2_500_000_000, arguments = [0, 0] }
disable_contract_version = { cost = 200, arguments = [0, 0, 0, 0] }
get_balance = { cost = 3_800, arguments = [0, 0, 0] }
get_balance = { cost = 3_000_000, arguments = [0, 0, 0] }
get_blocktime = { cost = 330, arguments = [0] }
get_caller = { cost = 380, arguments = [0] }
get_key = { cost = 2_000, arguments = [0, 440, 0, 0, 0] }
get_main_purse = { cost = 1_300, arguments = [0] }
get_named_arg = { cost = 200, arguments = [0, 0, 0, 0] }
get_named_arg = { cost = 200, arguments = [0, 120_000, 0, 120_000] }
get_named_arg_size = { cost = 200, arguments = [0, 0, 0] }
get_phase = { cost = 710, arguments = [0] }
get_system_contract = { cost = 1_100, arguments = [0, 0, 0] }
Expand All @@ -269,19 +269,19 @@ new_uref = { cost = 17_000, arguments = [0, 0, 590] }
random_bytes = { cost = 200, arguments = [0, 0] }
print = { cost = 20_000, arguments = [0, 4_600] }
provision_contract_user_group_uref = { cost = 200, arguments = [0, 0, 0, 0, 0] }
put_key = { cost = 38_000, arguments = [0, 1_100, 0, 0] }
put_key = { cost = 100_000_000, arguments = [0, 120_000, 0, 120_000] }
read_host_buffer = { cost = 3_500, arguments = [0, 310, 0] }
read_value = { cost = 6_000, arguments = [0, 0, 0] }
read_value = { cost = 60_000, arguments = [0, 120_000, 0] }
read_value_local = { cost = 5_500, arguments = [0, 590, 0] }
remove_associated_key = { cost = 4_200, arguments = [0, 0] }
remove_contract_user_group = { cost = 200, arguments = [0, 0, 0, 0] }
remove_contract_user_group_urefs = { cost = 200, arguments = [0, 0, 0, 0, 0, 0] }
remove_contract_user_group_urefs = { cost = 200, arguments = [0, 0, 0, 0, 0, 120_000] }
remove_key = { cost = 61_000, arguments = [0, 3_200] }
ret = { cost = 23_000, arguments = [0, 420_000] }
revert = { cost = 500, arguments = [0] }
set_action_threshold = { cost = 74_000, arguments = [0, 0] }
transfer_from_purse_to_account = { cost = 2_500_000_000, arguments = [0, 0, 0, 0, 0, 0, 0, 0, 0] }
transfer_from_purse_to_purse = { cost = 82_000, arguments = [0, 0, 0, 0, 0, 0, 0, 0] }
transfer_from_purse_to_purse = { cost = 82_000_000, arguments = [0, 0, 0, 0, 0, 0, 0, 0] }
transfer_to_account = { cost = 2_500_000_000, arguments = [0, 0, 0, 0, 0, 0, 0] }
update_associated_key = { cost = 4_200, arguments = [0, 0, 0] }
write = { cost = 14_000, arguments = [0, 0, 0, 980] }
Expand Down Expand Up @@ -321,7 +321,7 @@ mint = 2_500_000_000
reduce_total_supply = 10_000
create = 2_500_000_000
balance = 10_000
transfer = 10_000
transfer = 100_000_000
read_base_round_reward = 10_000
mint_into_existing_purse = 2_500_000_000

Expand All @@ -336,6 +336,26 @@ pay = 10_000


[vacancy]
# The cost of a transaction is based on a multiplier. This allows for economic disincentives for misuse of the network.
#
# The network starts with a current_gas_price of min_gas_price.
#
# Each block has multiple limits (bytes, transactions, transfers, gas, etc.)
# The utilization for a block is determined by the highest percentage utilization of each these limits.
#
# Ex: transfers limit is 650 and transactions limit is 20 (assume other limits are not a factor here)
# 19 transactons -> 19/20 or 95%
# 600 transfers -> 600/650 or 92.3%
# resulting block utilization is 95
#
# The utilization for an era is the average of all block utilizations. At the switch block, the dynamic gas_price is
# adjusted with the following:
#
# If utilization was below the lower_threshold, current_gas_price is decremented by one if higher than min_gas_price.
# If utilization falls between the thresholds, current_gas_price is not changed.
# If utilization was above the upper_threshold, current_gas_price is incremented by one if lower than max_gas_price.
#
# The cost charged for the transaction is simply the gas_used * current_gas_price.
upper_threshold = 90
lower_threshold = 50
max_gas_price = 3
Expand Down

0 comments on commit 79d5865

Please sign in to comment.