Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Remove multisig's Calls #12072

Merged
merged 7 commits into from
Sep 30, 2022
Merged

Remove multisig's Calls #12072

merged 7 commits into from
Sep 30, 2022

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Aug 19, 2022

Just removes the Calls item and its associated functionality, needed prior to 2D-weights integration.

TODO

  • Fix benchmarks
  • Fix tests
  • Consider migration to refund and clear Calls

@gavofyork gavofyork added the A3-in_progress Pull request is in progress. No review needed at this stage. label Aug 19, 2022
@github-actions github-actions bot added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Aug 19, 2022
@gavofyork gavofyork marked this pull request as draft August 19, 2022 13:01
@gavofyork gavofyork added A3-in_progress Pull request is in progress. No review needed at this stage. E6-transactionversion and removed A0-please_review Pull request needs code review. labels Aug 19, 2022
@ruseinov
Copy link
Contributor

ruseinov commented Sep 8, 2022

bot rebase

@paritytech-processbot
Copy link

Rebased

@ruseinov
Copy link
Contributor

bot rebase

@paritytech-processbot
Copy link

Branch is already up-to-date

@kianenigma
Copy link
Contributor

being worked on here #12072

* Fix tests and re-introduce reserve logic

* fix benches

* add todo

* remove irrelevant bench
@ruseinov
Copy link
Contributor

The only thing left is the migration.

@ruseinov
Copy link
Contributor

bot rebase

@paritytech-processbot
Copy link

Branch is already up-to-date

@ruseinov
Copy link
Contributor

bot rebase

@paritytech-processbot
Copy link

Rebased

* [Feature] Add a migration that drains and refunds stored calls

* migration fixes

* fixes

* address review comments

* consume the whole block weight

* fix assertions

* license header

* fix interface

Co-authored-by: parity-processbot <>
@ruseinov ruseinov marked this pull request as ready for review September 29, 2022 14:48
@github-actions github-actions bot added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Sep 29, 2022
@ruseinov
Copy link
Contributor

@kianenigma @gavofyork @ggwpez let's give it a final look-through and merge into it's parent branch, then we can merge this paritytech/polkadot#6075 into the companion.

@ruseinov
Copy link
Contributor

This has some build errors, because of updates in master, I'd say it's probably best to merge this into it's parent branch and fix those build errors there along with the others to expedite the process.

@ruseinov ruseinov added E1-runtimemigration D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Sep 29, 2022
@gavofyork gavofyork merged commit 13c6993 into gav-no-stored-call Sep 30, 2022
@gavofyork gavofyork deleted the gav-rm-multisig-calls branch September 30, 2022 10:38
gavofyork added a commit that referenced this pull request Oct 5, 2022
* Introduce preimages module in traits

* Multisize Preimages

* Len not actually necessary

* Tweaks to the preimage API

* Fixes

* Get Scheduler building with new API

* Scheduler tests pass

* Bounded Scheduler 🎉

* Use Agenda holes and introduce IncompleteSince to avoid need to reschedule

* Tests pass with new weight system

* New benchmarks

* Add missing file

* Drop preimage when permenantly overeight

* Drop preimage when permenantly overeight

* Referenda uses latest preimage API

* Testing ok

* Adding tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add preimage migration

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Docs

* Remove dbg

* Refactor Democracy

* Refactor Democracy

* Add final MEL

* Remove silly maps

* Fixes

* Minor refactor

* Formatting

* Fixes

* Fixes

* Fixes

* Update frame/preimage/src/lib.rs

Co-authored-by: Shawn Tabrizi <[email protected]>

* Add migrations to Democracy

* WIP

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Resolve conflicts

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Revert "Resolve conflicts"

This reverts commit a89cd0a.

* Undo wrong resolves...

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* WIP

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* massage clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* clippy annoyance

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* clippy annoyance

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix benchmarks

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* add missing file

* Test <Preimage as QueryPreimage>

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Clippy harassment

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fixup tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove old stuff

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Test <Scheduler as Anon> trait functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update pallet-ui tests

Why is this needed? Should not be the case unless master is broken...

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More scheduler trait test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Apply review suggestion

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Beauty fixes

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add Scheduler test migration_v3_to_v4_works

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Merge fixup

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Keep referenda benchmarks instantiatable

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update weights

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use new scheduler weight functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use new democracy weight functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use weight compare functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update pallet-ui tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More renaming…

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More renaming…

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add comment

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Implement OnRuntimeUpgrade for scheduler::v3_to_v4 migration

Put the migration into a proper `MigrateToV4` struct and implement
the OnRuntimeUpgrade hooks for it. Also move the test to use that
instead.

This should make it easier for adding it to Polkadot.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Handle undecodable Agendas

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove trash

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use new OnRuntimeUpgrade functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fix test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix BoundedSlice::truncate_from

Co-authored-by: jakoblell

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix pre_upgrade hook return values

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add more error logging

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Find too large preimages in the pre_upgrade hook

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Test that too large Calls in agendas are ignored

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use new OnRuntimeUpgrade hooks

Why did the CI not catch this?!

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* works fine - just more logs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix staking migration

Causing issues on Kusama...

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix UI tests

No idea why this is needed. This is actually undoing an earlier change.
Maybe the CI has different rustc versions!?

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove multisig's Calls (#12072)

* Remove multisig's Calls

* Multisig: Fix tests and re-introduce reserve logic (#12241)

* Fix tests and re-introduce reserve logic

* fix benches

* add todo

* remove irrelevant bench

* [Feature] Add a migration that drains and refunds stored calls (#12313)

* [Feature] Add a migration that drains and refunds stored calls

* migration fixes

* fixes

* address review comments

* consume the whole block weight

* fix assertions

* license header

* fix interface

Co-authored-by: parity-processbot <>

Co-authored-by: parity-processbot <>
Co-authored-by: Roman Useinov <[email protected]>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix multisig benchmarks

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* ".git/.scripts/bench-bot.sh" pallet dev pallet_democracy

* ".git/.scripts/bench-bot.sh" pallet dev pallet_scheduler

* ".git/.scripts/bench-bot.sh" pallet dev pallet_preimage

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: parity-processbot <>
Co-authored-by: Roman Useinov <[email protected]>
@louismerlin louismerlin added D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited and removed D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Oct 12, 2022
@@ -237,45 +188,6 @@ benchmarks! {
assert_eq!(multisig.approvals.len(), 2);
}

approve_as_multi_complete {
Copy link
Member

Choose a reason for hiding this comment

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

@ruseinov can you help me to understand why this is not needed anymore?

@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis/1026/2

@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-digest-11-jan-2023/1654/1

@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-34/1432/8

ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Introduce preimages module in traits

* Multisize Preimages

* Len not actually necessary

* Tweaks to the preimage API

* Fixes

* Get Scheduler building with new API

* Scheduler tests pass

* Bounded Scheduler 🎉

* Use Agenda holes and introduce IncompleteSince to avoid need to reschedule

* Tests pass with new weight system

* New benchmarks

* Add missing file

* Drop preimage when permenantly overeight

* Drop preimage when permenantly overeight

* Referenda uses latest preimage API

* Testing ok

* Adding tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add preimage migration

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Docs

* Remove dbg

* Refactor Democracy

* Refactor Democracy

* Add final MEL

* Remove silly maps

* Fixes

* Minor refactor

* Formatting

* Fixes

* Fixes

* Fixes

* Update frame/preimage/src/lib.rs

Co-authored-by: Shawn Tabrizi <[email protected]>

* Add migrations to Democracy

* WIP

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Resolve conflicts

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Revert "Resolve conflicts"

This reverts commit a89cd0a.

* Undo wrong resolves...

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* WIP

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make compile

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* massage clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* clippy annoyance

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* clippy annoyance

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix benchmarks

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* add missing file

* Test <Preimage as QueryPreimage>

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Clippy harassment

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fixup tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove old stuff

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Test <Scheduler as Anon> trait functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update pallet-ui tests

Why is this needed? Should not be the case unless master is broken...

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More scheduler trait test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Apply review suggestion

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Beauty fixes

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add Scheduler test migration_v3_to_v4_works

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Merge fixup

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Keep referenda benchmarks instantiatable

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update weights

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use new scheduler weight functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use new democracy weight functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use weight compare functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Update pallet-ui tests

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More renaming…

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* More renaming…

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add comment

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Implement OnRuntimeUpgrade for scheduler::v3_to_v4 migration

Put the migration into a proper `MigrateToV4` struct and implement
the OnRuntimeUpgrade hooks for it. Also move the test to use that
instead.

This should make it easier for adding it to Polkadot.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Handle undecodable Agendas

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove trash

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use new OnRuntimeUpgrade functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fix test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix BoundedSlice::truncate_from

Co-authored-by: jakoblell

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix pre_upgrade hook return values

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Add more error logging

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Find too large preimages in the pre_upgrade hook

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Test that too large Calls in agendas are ignored

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use new OnRuntimeUpgrade hooks

Why did the CI not catch this?!

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* works fine - just more logs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix staking migration

Causing issues on Kusama...

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix UI tests

No idea why this is needed. This is actually undoing an earlier change.
Maybe the CI has different rustc versions!?

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Remove multisig's Calls (paritytech#12072)

* Remove multisig's Calls

* Multisig: Fix tests and re-introduce reserve logic (paritytech#12241)

* Fix tests and re-introduce reserve logic

* fix benches

* add todo

* remove irrelevant bench

* [Feature] Add a migration that drains and refunds stored calls (paritytech#12313)

* [Feature] Add a migration that drains and refunds stored calls

* migration fixes

* fixes

* address review comments

* consume the whole block weight

* fix assertions

* license header

* fix interface

Co-authored-by: parity-processbot <>

Co-authored-by: parity-processbot <>
Co-authored-by: Roman Useinov <[email protected]>

* Fix test

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix multisig benchmarks

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* ".git/.scripts/bench-bot.sh" pallet dev pallet_democracy

* ".git/.scripts/bench-bot.sh" pallet dev pallet_scheduler

* ".git/.scripts/bench-bot.sh" pallet dev pallet_preimage

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Shawn Tabrizi <[email protected]>
Co-authored-by: parity-processbot <>
Co-authored-by: Roman Useinov <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants