Skip to content

Move to 6s Blocktimes #1920

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

Closed
7 tasks done
wilwade opened this issue Mar 13, 2024 · 8 comments
Closed
7 tasks done

Move to 6s Blocktimes #1920

wilwade opened this issue Mar 13, 2024 · 8 comments
Assignees

Comments

@wilwade
Copy link
Collaborator

wilwade commented Mar 13, 2024

When async backing is supported on Polkadot, Frequency can move to a default of 6s block times.

  • Polkadot enabled 6s block times

Tasks

  • Upgrade Polkadot-SDK to v1.8.0+
  • Update our blocktime from 12 to 6 via MILLISECS_PER_BLOCK
  • Review and update Governance times via migration
  • Review and update Capacity epoch times #2141
  • Review and possibly update message pagination
  • Change the default interval sealing time

Helpful resources

@wilwade wilwade added the discussion Topic for Discussion at a Community Call label May 15, 2024
@enddynayn enddynayn self-assigned this Jun 10, 2024
@wilwade wilwade removed the discussion Topic for Discussion at a Community Call label Jun 18, 2024
@enddynayn
Copy link
Collaborator

Should we also update the mortality window for signature verification?

@enddynayn
Copy link
Collaborator

Hi @wilwade, @aramikm and I took a look at the “Review and possibly update message pagination” check item, but we couldn’t find anything that seemed like it needed updating. Could you clarify what changes you’re thinking of? Just want to make sure we get those updates in. Thanks!

@enddynayn
Copy link
Collaborator

enddynayn commented Oct 4, 2024

Do we know the intended duration for the following constant?

/// The number of blocks for Stateful mortality is 24 hours
pub type StatefulMortalityWindowSize = ConstU32<14400>;

link to code

The comment mentions that the mortality window is meant to be 24 hours, but with a 12-second block time, it actually covers two days. Once we update to 6-second block times, it would match the 1-day duration.

Could you clarify the correct intention here — should the mortality window be 1 day or 2 days?

@wilwade
Copy link
Collaborator Author

wilwade commented Oct 4, 2024

Should we also update the mortality window for signature verification?

Yes!

The other ones @aramikm is better to answer than I.

@enddynayn
Copy link
Collaborator

@wilwade For the “Review and update Governance times via migration” task, I went through all the constants to check if any needed updating but couldn't find any that required changes. I also looked into whether any migrations were necessary and didn't find anything there either. Additionally, I checked the Polkadot releases for references to any related migrations but found nothing. I also checked with @shannonwells to see if there was anything she was aware of, but nothing came up.

Was there a specific migration you had in mind?

@wilwade
Copy link
Collaborator Author

wilwade commented Oct 7, 2024

@enddynayn I do not know of any other particular ones.

I did a quick look through the ones I was worried about (like CouncilMotionDuration), but they all look like they are defined as config values not genesis config. (and based on DAYS / HOURS / etc... which is all defined by the MILLISECS_PER_BLOCK)

I don't see any other genesis_config on a quick look either, so I think we got them all!

@enddynayn
Copy link
Collaborator

@wilwade Got it, I noticed those as well and went through the config parameters. Thanks for taking another look.

enddynayn added a commit that referenced this issue Oct 8, 2024
This update reduces block time to 6 seconds. As a result, the Capacity
Epoch length has been adjusted to account for the reduced latency.
Additionally, the default interval sealing time has been changed to 6
seconds.

A migration has also been added to update the StorageVersion of the
CollatorSelection pallet.

Commands to test the runtime migration:

Paseo
```
make try-runtime-create-snapshot-paseo-testnet
make try-runtime-use-snapshot-paseo-testnet
```

Mainnet
```
cargo build --features frequency,try-runtime&& \
try-runtime --runtime ./target/release/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade live --uri wss://1.rpc.frequency.xyz:443 --pallet Capacity --pallet System
```

Or

Paseo
```
cargo build --features frequency,try-runtime && \
try-runtime --runtime ./target/release/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade live --uri wss://1.rpc.frequency.xyz:443 --pallet Capacity --pallet System
```

```
cargo build --features frequency-testnet,try-runtime && \
try-runtime --runtime ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade live --uri wss://rpc.testnet.amplica.io:443 -pallet  Capacity --pallet
```

<img width="1286" alt="Screenshot 2024-10-07 at 3 13 25 PM"
src="https://github.com/user-attachments/assets/045f2bf1-cafc-41a1-b7f6-0baf12795b87">


#1920 
#2141

---------

Co-authored-by: enddynayn <[email protected]>
@wilwade
Copy link
Collaborator Author

wilwade commented Oct 21, 2024

Merged.

@wilwade wilwade closed this as completed Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants