Open Discussion Thread: Fall 2022 Roadmap Roundup

(This is getting off topic…)

For Acala / Karura, our vesting is implemented using orml-vesting + relaychain block number so we won’t have issue on this when parachain block time changes from 12s to 6s. Use RelaychainBlockNumberProvider if you want to access it.

One easy migration for parachains using their own block number is by switching to relaychain_block_numebr * 2 - some_constant. By picking the right constant, this ensures this number won’t be impacted by change of parachain block time. No onchain state migration are needed.

Speak of why block number instead of timestamp:

  • Timestamp can be manipulated by block producers to some degree
  • Timestamp is not monotonic. Block number is.
    • For example, if you want a logic to be executed every minute (or 5 block for 12s block time). Using block number guarantees one execute per 5 block. No edge cases. Using timestamp and you need to record the last execution time, and check time change since last executed time, and handle edge cases such as time goes backwards etc. The logic is simply lot more complicated.
1 Like