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

fix: adds delivery fees config and base weights #11

Merged
merged 13 commits into from
May 4, 2024

Conversation

al3mart
Copy link
Contributor

@al3mart al3mart commented Apr 30, 2024

Adds a default configuration for delivery fees that doesn't charge to the relay nor the sibling system parachains and collecting the fee in the account corresponding to the treasury module (non existent in the template right now) .
Also declares the type WeightInfo for each pallet with the base weights provided in the pallet.

Motivation for changes comes from similarities found at SRLabs audit: https://github.com/OpenZeppelin/polkadot-generic-runtime-template/blob/main/audits/2024-04.pdf

@evilrobot-01
Copy link
Contributor

Nice! Can we add some unit tests in the runtime to assert that these values are set correctly, and remain that way so that no regressions occur?

@evilrobot-01
Copy link
Contributor

Can we reorder

[frame_system, SystemBench::<Runtime>]
in line with the order of the pallets defined in the runtime, ensuring that all those that are included in the runtime are included in this list?

It would be good to also add a comment somewhere within construct_runtime as a reminder to ensure that they are added to define_benchmarks, for any template users.

runtime/src/lib.rs Outdated Show resolved Hide resolved
@evilrobot-01 evilrobot-01 changed the title fix(base): Adds delivery fees config and base weights. fix: adds delivery fees config and base weights May 3, 2024
runtime/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@evilrobot-01 evilrobot-01 left a comment

Choose a reason for hiding this comment

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

Made a few tweaks, so looks good to me.

Ideally we would have tests for these changes, but that might be overkill for a template. We can always port any applicable tests built downstream back here in the future.

@evilrobot-01 evilrobot-01 merged commit 992fea6 into main May 4, 2024
5 checks passed
@evilrobot-01 evilrobot-01 deleted the al3mart/fix-delivery-fees branch May 6, 2024 10:06
AlexD10S referenced this pull request in r0gue-io/contracts-parachain May 10, 2024
* ci: add workflow (#12)

* chore: pin rust channel to version used for polkadot

* style: formatting using rust version

* refactor: address clippy warnings

* ci: add workflow

* ci: add missing packages

* ci: various fixes

* ci: use cache

* fix: adds delivery fees config and base weights (#11)

* fix(base): delivery fees

* fix(base): declare WeightInfo for every pallet

* style(base): fmt

* style(base): undo fmt

* fix(base): remove example zombienet file

* fix(base): Add treasury clarification

* fix(base): weights & benchmarks

* fix: remove erroneous pallets

* docs: add benchmark comment for consistency

* fix(runtime): use unit type for weightinfo for consistency

* docs(runtime): add additional context

* fix(xcm): filter teleports to disable

---------

Co-authored-by: Frank Bell <frank@r0gue.io>

* chore: remove deprecated polkadot-launch (r0gue-io#14)

* ci: add workflow for linting pr titles (r0gue-io#15)

* fix: update default para id

* chore: sync with base parachain

---------

Co-authored-by: Frank Bell <60948618+evilrobot-01@users.noreply.github.com>
Co-authored-by: Alejandro Martinez Andres <11448715+al3mart@users.noreply.github.com>
Co-authored-by: Frank Bell <frank@r0gue.io>
Co-authored-by: Daan van der Plas <93204684+Daanvdplas@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

5 participants