Skip to content

Commit

Permalink
fix(chain-params): 5s blocks to account for global round-trip time
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Dec 7, 2020
1 parent f836802 commit 6fac324
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/agoric-cli/lib/chain-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import TOML from '@iarna/toml';
export const MINT_DENOM = 'uag';
export const STAKING_DENOM = 'uagstake';
export const GOV_DEPOSIT_COINS = [{ amount: '10000000', denom: MINT_DENOM }];
export const BLOCK_CADENCE_S = 2;

// Can't beat the speed of light, we need 600ms round trip time for the other
// side of Earth, and multiple round trips per block.
//
// 5 seconds is about as fast as we can go without penalising validators.
export const BLOCK_CADENCE_S = 5;

export const ORIG_BLOCK_CADENCE_S = 5;
export const ORIG_SIGNED_BLOCKS_WINDOW = 100;
Expand Down Expand Up @@ -89,9 +94,5 @@ export function finishCosmosGenesis({ genesisJson, exportedGenesisJson }) {
genesis.initial_height = exported.initial_height;
}

// Should be equal to the block cadence in milliseconds, according to @melekes
// on Discord.
genesis.consensus_params.block.time_iota_ms = `${BLOCK_CADENCE_S * 1000}`;

return djson.stringify(genesis);
}

0 comments on commit 6fac324

Please sign in to comment.