Skip to content
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

chore(genesis): move development genesis config to runtime #2152

Merged
merged 5 commits into from
Oct 1, 2024

Conversation

enddynayn
Copy link
Collaborator

@enddynayn enddynayn commented Sep 5, 2024

Move Development Genesis Config to the Runtime to
support decoupling of client and runtime dependencies.

When running chain-spec-builder, the following command:

chain-spec-builder list-presets –-runtime-wasm-path ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm

Outputs:
With feature flags "frequency-no-relay", "frequency-local" enabled:

{“presets”:[“development”, "frequency-local", "frequency"]}

Additionally, when running:

chain-spec-builder display-preset --runtime-wasm-path ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm --preset-name development

it outputs the development genesis config:

{"aura":{"authorities":[]},"auraExt":{},"balances":{ ...} ... }

With feature flags "frequency" only, mainnet presets show up:

{“presets”:["frequency"]}

Additionally, when running:

chain-spec-builder display-preset --runtime-wasm-path ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm --preset-name frequency

it outputs the frequency genesis config:

{"aura":{"authorities":[]},"auraExt":{},"balances":{ ...} ... }

#2149
#2142

Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

@enddynayn enddynayn force-pushed the chore/mv-development-genesis-to-runtime-issue-2149 branch 2 times, most recently from adb092a to 66145ee Compare September 5, 2024 14:54
@enddynayn enddynayn changed the title Chore/mv development genesis to runtime issue 2149 chore(genesis): move development genesis config to runtime Sep 5, 2024
@enddynayn enddynayn force-pushed the chore/mv-development-genesis-to-runtime-issue-2149 branch 2 times, most recently from 7a032a9 to 28770ba Compare September 5, 2024 15:30
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 6, 2024
@enddynayn enddynayn force-pushed the chore/mv-development-genesis-to-runtime-issue-2149 branch from 17d61a3 to bd280f3 Compare September 6, 2024 17:11
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 6, 2024
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 6, 2024
@enddynayn enddynayn force-pushed the chore/mv-development-genesis-to-runtime-issue-2149 branch from 820ea2c to 26952b6 Compare September 6, 2024 19:15
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 6, 2024
JoeCap08055
JoeCap08055 previously approved these changes Sep 6, 2024
Copy link
Collaborator

@JoeCap08055 JoeCap08055 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Reviewed changes
  • Built & ran node, verified genesis config
  • Ran unit & e2e tests, passing

wilwade
wilwade previously requested changes Sep 6, 2024
Copy link
Collaborator

@wilwade wilwade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't gotten all the way through, but wanted to call out one fix. The rest looks good so far. Excited to see this happening!

runtime/frequency/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good one concern is bloating the size of runtime wasm. We already know wasm has a size limit on the polkadot and if it's bigger than a certain size the upgrade won't work.

runtime/frequency/src/apis.rs Show resolved Hide resolved
Copy link
Collaborator

@mattheworris mattheworris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Read through changes

🚢 it!

deny.toml Outdated Show resolved Hide resolved
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 27, 2024
@wilwade wilwade dismissed their stale review September 30, 2024 17:18

My own review

@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Sep 30, 2024
@enddynayn enddynayn force-pushed the chore/mv-development-genesis-to-runtime-issue-2149 branch from d47f870 to b497605 Compare September 30, 2024 17:37
Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some questions and nits.

.github/workflows/verify-pr-commit.yml Outdated Show resolved Hide resolved
runtime/frequency/src/development_genesis.rs Outdated Show resolved Hide resolved
runtime/frequency/src/development_genesis.rs Outdated Show resolved Hide resolved
@aramikm aramikm self-requested a review September 30, 2024 18:13
@enddynayn enddynayn marked this pull request as draft September 30, 2024 18:18
Move Development Genesis Config to the Runtime to
support decoupling of client and runtime dependencies.

When running `chain-spec-builder`, the following command:

```
chain-spec-builder list-presets –-runtime-wasm-path ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm
```

outputs:
```
{“presets”:[“development”]}
```

Additionally, when running:
```
chain-spec-builder display-preset --runtime-wasm-path ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm --preset-name development
```

it outputs the development genesis config:
```
{"aura":{"authorities":[]},"auraExt":{},"balances":{ ...} ... }
```

issue-2149
issue-2142
Move the Frequency and Paseo genesis configurations to the runtime.
Additionally, refactor the genesis builder for Paseo, Frequency,
and Development into a single genesis_builder function.
@enddynayn enddynayn force-pushed the chore/mv-development-genesis-to-runtime-issue-2149 branch from 4b8b5b2 to 00e453c Compare September 30, 2024 19:27
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 30, 2024
@enddynayn enddynayn marked this pull request as ready for review September 30, 2024 21:44
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Sep 30, 2024
Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the code and looked good.

vec![
sp_genesis_builder::PresetId::from("development"),
sp_genesis_builder::PresetId::from("frequency-local"),
sp_genesis_builder::PresetId::from("frequency"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why do you need frequency for local features?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question! This is something I mentioned during our stand-up, and I believe we agreed that having the frequency feature enabled by default was ok.

@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 30, 2024
Copy link
Collaborator

@mattheworris mattheworris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Read through changes

Copy link
Collaborator

@claireolmstead claireolmstead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read through this PR. Was mainly focused on code organization and naming since I'm not a pro in all of the rust semantics. That being said, looks good to me!

@enddynayn enddynayn dismissed JoeCap08055’s stale review October 1, 2024 12:10

Can you please take another look? Requesting a new review because of new changes.

Copy link
Collaborator

@JoeCap08055 JoeCap08055 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

  • Ran unit tests
  • Ran e2e tests
  • Inspected build with chain-spec-builder

@enddynayn enddynayn merged commit 8e6c002 into main Oct 1, 2024
27 checks passed
@enddynayn enddynayn deleted the chore/mv-development-genesis-to-runtime-issue-2149 branch October 1, 2024 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata-changed Metadata has changed since the latest full release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants