-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update pregenesis.sh
script for testnet4
#628
Conversation
WalkthroughThe changes primarily focus on updating the testnet setup scripts, including modifications to chain ID, token balances, validator initialization, and genesis time. The consensus parameters are removed, and denomination metadata is introduced. The changes aim to enhance the configuration of the testnet environment and do not affect the core logic of the protocol. Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Files selected for processing (1)
- protocol/testing/testnet-external/pregenesis.sh (3 hunks)
Additional comments (Suppressed): 3
protocol/testing/testnet-external/pregenesis.sh (3)
52-52: The chain ID has been updated from "dydx-testnet-3" to "dydx-testnet-4". Ensure that this change is reflected across all services and components that interact with this chain.
163-165: The consensus parameters have been removed from the script. This could potentially alter the network's consensus mechanism and its behavior. Please verify if this was intentional and if it has been tested thoroughly.
221-224: The initial stake balance and self-delegation amounts for validators have been replaced with constants
TESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE
andTESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT
. This standardizes these values across all validators, potentially affecting the distribution of power within the network. Ensure that these changes are in line with the intended design of the testnet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Files selected for processing (2)
- protocol/testing/genesis.sh (1 hunks)
- protocol/testing/testnet-external/pregenesis.sh (5 hunks)
Files skipped from review due to trivial changes (1)
- protocol/testing/genesis.sh
Additional comments (Suppressed): 6
protocol/testing/testnet-external/pregenesis.sh (6)
52-52: The
CHAIN_ID
has been updated from "dydx-testnet-3" to "dydx-testnet-4". Ensure that all references to the chain ID in the codebase have been updated to match this new value.64-64: The
FAUCET_STAKE_BALANCE
variable has been removed. Ensure that this does not affect any other parts of the code that might be using this variable.161-163: The consensus parameters have been removed. If these parameters are not set elsewhere, this could affect the consensus mechanism of the blockchain. Please verify.
185-188: The
FAUCET_BALANCE
variable has been updated to useFAUCET_NATIVE_TOKEN_BALANCE
instead ofFAUCET_STAKE_BALANCE
. Ensure that this change is reflected whereverFAUCET_BALANCE
is used.219-222: The
VALIDATOR_INITIAL_STAKE_BALANCE
variable has been replaced withTESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE
. Ensure that this change is reflected whereverVALIDATOR_INITIAL_STAKE_BALANCE
is used.224-224: The
VALIDATOR_INITIAL_SELF_DELEGATION
variable has been replaced withTESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT
. Ensure that this change is reflected whereverVALIDATOR_INITIAL_SELF_DELEGATION
is used.
# Each testnet validator self-delegates 500k whole coins of native token. | ||
TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT=500000$EIGHTEEN_ZEROS # 5e23 | ||
TESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT=500000$EIGHTEEN_ZEROS # 5e23 or 500k native tokens. | ||
FAUCET_NATIVE_TOKEN_BALANCE=50000000$EIGHTEEN_ZEROS # 5e25 or 50 million native tokens. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
~60 validators + 3 faucet + 1 rewards vester = 60 million + 150 million + 10 million = 220 million = 22% of total supply.
Note we will need to manually update the bridge module balance after gentx
process is complete to make it add up to 1 billion total supply
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Files selected for processing (1)
- protocol/testing/genesis.sh (2 hunks)
Additional comments (Suppressed): 4
protocol/testing/genesis.sh (4)
22-28: The introduction of
FAUCET_NATIVE_TOKEN_BALANCE
and the update ofTESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE
andTESTNET_VALIDATOR_SELF_DELEGATE_AMOUNT
are significant changes. Ensure that these new values are compatible with the rest of the system and that they meet the requirements of the new testnet.36-37: The introduction of a fixed
GENESIS_TIME
is a significant change. Make sure that this time is appropriate for the new testnet and that it doesn't conflict with any other operations or assumptions in the system.39-41: The
edit_genesis
function now takes a parameter, which is a change from the previous version. Ensure that all calls to this function have been updated to pass the appropriate argument.68-69: The addition of the
genesis_time
field to thegenesis.json
file is a significant change. Ensure that this field is correctly used elsewhere in the system and that its value is correctly set.
@@ -163,19 +161,12 @@ function overwrite_genesis_public_testnet() { | |||
dasel put -t string -f "$GENESIS" '.app_state.gov.params.quorum' -v '0.33400' # 33.4% | |||
dasel put -t string -f "$GENESIS" '.app_state.gov.params.threshold' -v '0.50000' # 50% | |||
dasel put -t string -f "$GENESIS" '.app_state.gov.params.veto_threshold' -v '0.33400' # 33.4% | |||
|
|||
# Consensus params | |||
dasel put -t string -f "$GENESIS" '.consensus_params.block.max_bytes' -v '22020096' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my own understanding, why are we removing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm, I think this is removed so we can keep the 4mib value that we settled one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Files selected for processing (2)
- protocol/testing/genesis.sh (3 hunks)
- protocol/testing/testnet-external/pregenesis.sh (6 hunks)
Additional comments (Suppressed): 11
protocol/testing/genesis.sh (5)
24-25: New variables
NATIVE_TOKEN_WHOLE_COIN
andCOIN_NAME
are introduced. Ensure that these are used correctly throughout the codebase.30-30: The
FAUCET_NATIVE_TOKEN_BALANCE
is set to 50 million native tokens. Make sure this balance is appropriate for the testnet environment.39-39: The
GENESIS_TIME
is set to a fixed date. Ensure that this date is appropriate and does not cause any issues with the testnet.70-75: The
edit_genesis
function is updated to modify thegenesis_time
field in thegenesis.json
file. Ensure that this change does not affect the functionality of the testnet.1030-1031: The
set_denom_metadata
function is called to set denomination metadata for the native token. Ensure that this function is implemented correctly and that it does not introduce any issues.protocol/testing/testnet-external/pregenesis.sh (6)
52-52: The
CHAIN_ID
has been updated from "dydx-testnet-3" to "dydx-testnet-4". Ensure that all references to the chain ID in the codebase have been updated to match this new value.64-64: The
FAUCET_STAKE_BALANCE
variable has been removed. Ensure that this does not affect any other parts of the code that may be using this variable.138-138: The
signed_blocks_window
parameter in the slashing params has been updated from '12000' to '12288'. This change should be verified to ensure it aligns with the intended slashing policy.161-163: The consensus parameters have been removed. Ensure that this does not affect the consensus mechanism or any other parts of the code that may be using these parameters.
185-188: The
FAUCET_BALANCE
is now initialized withFAUCET_NATIVE_TOKEN_BALANCE
instead ofFAUCET_STAKE_BALANCE
. IfSEED_FAUCET_USDC
is true, the faucet is initialized with USDC balance in addition to the native token balance. Ensure that this change aligns with the intended token distribution policy.219-222: The
VALIDATOR_INITIAL_STAKE_BALANCE
variable has been replaced withTESTNET_VALIDATOR_NATIVE_TOKEN_BALANCE
when initializing the validator account ingenesis.json
. Ensure that this change aligns with the intended validator token balance policy.
Changelist
Update pregenesis.sh script for testnet 4
Generate pregenesis file here
Test Plan
N/A