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

Bound uses of Call #11649

Merged
merged 112 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from 92 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
40c2ba9
Introduce preimages module in traits
gavofyork Jun 12, 2022
3cb8e01
Multisize Preimages
gavofyork Jun 12, 2022
63ed95c
Len not actually necessary
gavofyork Jun 12, 2022
0fd5714
Tweaks to the preimage API
gavofyork Jun 12, 2022
1ef2d71
Fixes
gavofyork Jun 12, 2022
8b4977c
Get Scheduler building with new API
gavofyork Jun 13, 2022
357cc6a
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
gavofyork Jun 13, 2022
769e953
Scheduler tests pass
gavofyork Jun 13, 2022
933e83a
Bounded Scheduler 🎉
gavofyork Jun 13, 2022
ba676a1
Use Agenda holes and introduce IncompleteSince to avoid need to resch…
gavofyork Jun 13, 2022
631891c
Tests pass with new weight system
gavofyork Jun 17, 2022
2d31ac8
New benchmarks
gavofyork Jun 17, 2022
84f92fe
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
gavofyork Jun 19, 2022
0178600
Add missing file
gavofyork Jun 19, 2022
9c48793
Merge branch 'gav-no-stored-call' of github.com:paritytech/substrate …
gavofyork Jun 19, 2022
5d73773
Drop preimage when permenantly overeight
gavofyork Jun 19, 2022
82ac0dc
Drop preimage when permenantly overeight
gavofyork Jun 20, 2022
ec4d8e1
Referenda uses latest preimage API
gavofyork Jun 20, 2022
b1a6835
Testing ok
gavofyork Jun 20, 2022
e10eae7
Adding tests
ggwpez Jun 21, 2022
4f15361
fmt
ggwpez Jun 21, 2022
1cbf473
Add preimage migration
ggwpez Jun 13, 2022
aab0ad1
Docs
gavofyork Jun 22, 2022
79271bc
Merge branch 'gav-no-stored-call' of github.com:paritytech/substrate …
gavofyork Jun 22, 2022
9bcc2ef
Remove dbg
gavofyork Jun 22, 2022
6359cb0
Refactor Democracy
gavofyork Jun 23, 2022
dd50271
Refactor Democracy
gavofyork Jun 23, 2022
48b795a
Add final MEL
gavofyork Jun 23, 2022
484670f
Remove silly maps
gavofyork Jun 23, 2022
0690846
Fixes
gavofyork Jun 23, 2022
6780a75
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
gavofyork Jun 24, 2022
9572f81
Minor refactor
gavofyork Jun 24, 2022
b3e8d6e
Formatting
gavofyork Jun 24, 2022
db99f24
Fixes
gavofyork Jun 24, 2022
9e1c25b
Fixes
gavofyork Jun 24, 2022
c542f7f
Fixes
gavofyork Jun 24, 2022
0b8c496
Update frame/preimage/src/lib.rs
gavofyork Jun 24, 2022
44a6b5f
Add migrations to Democracy
gavofyork Jun 24, 2022
466e4a0
WIP
ggwpez Aug 31, 2022
a89cd0a
Resolve conflicts
ggwpez Aug 31, 2022
8849049
Revert "Resolve conflicts"
ggwpez Aug 31, 2022
d349bc0
Merge master
ggwpez Aug 31, 2022
785d9e6
Undo wrong resolves...
ggwpez Aug 31, 2022
9728b78
WIP
ggwpez Aug 31, 2022
32d7aa8
Make compile
ggwpez Aug 31, 2022
e488eca
massage clippy
ggwpez Aug 31, 2022
63c8517
More clippy
ggwpez Aug 31, 2022
20656ce
clippy annoyance
ggwpez Aug 31, 2022
6c99921
clippy annoyance
ggwpez Aug 31, 2022
11dfb6a
Fix benchmarks
ggwpez Sep 1, 2022
4ac00b6
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 1, 2022
3db7abf
add missing file
gavofyork Sep 1, 2022
f4d639e
Add missing file
gavofyork Sep 1, 2022
7e0b347
Test <Preimage as QueryPreimage>
ggwpez Sep 1, 2022
cf86a1a
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 2, 2022
2f41c0d
More tests
ggwpez Sep 2, 2022
1c671c9
Clippy harassment
ggwpez Sep 2, 2022
76da5fb
Add test
ggwpez Sep 5, 2022
14ca132
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 5, 2022
956e4cf
clippy
ggwpez Sep 5, 2022
ffde364
Fixup tests
ggwpez Sep 5, 2022
870a9d5
Remove old stuff
ggwpez Sep 5, 2022
5c1a253
fmt
ggwpez Sep 5, 2022
3bcf6a1
Test <Scheduler as Anon> trait functions
ggwpez Sep 5, 2022
957a45e
Update pallet-ui tests
ggwpez Sep 5, 2022
fd220e6
More scheduler trait test
ggwpez Sep 5, 2022
eb2ce75
More tests
ggwpez Sep 6, 2022
763c86a
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 6, 2022
713f685
Apply review suggestion
ggwpez Sep 6, 2022
f2a3792
Beauty fixes
ggwpez Sep 6, 2022
25f624c
Add Scheduler test migration_v3_to_v4_works
ggwpez Sep 7, 2022
1415583
Merge fixup
ggwpez Sep 7, 2022
d142086
Keep referenda benchmarks instantiatable
ggwpez Sep 7, 2022
81013b9
Update weights
ggwpez Sep 7, 2022
47d4759
Use new scheduler weight functions
ggwpez Sep 7, 2022
3c42ca3
Use new democracy weight functions
ggwpez Sep 7, 2022
2282050
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 7, 2022
ff9e860
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 12, 2022
54ceffb
Use weight compare functions
ggwpez Sep 12, 2022
9764d05
Update pallet-ui tests
ggwpez Sep 12, 2022
531c334
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 13, 2022
bd84085
More renaming…
ggwpez Sep 13, 2022
307e784
More renaming…
ggwpez Sep 13, 2022
a255822
Add comment
ggwpez Sep 14, 2022
4005e94
Implement OnRuntimeUpgrade for scheduler::v3_to_v4 migration
ggwpez Sep 14, 2022
93bb222
Clippy
ggwpez Sep 14, 2022
87b5c25
Handle undecodable Agendas
ggwpez Sep 19, 2022
2eaddda
Remove trash
ggwpez Sep 19, 2022
121f8db
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 21, 2022
c6a64d5
Fix test
ggwpez Sep 21, 2022
2532867
Use new OnRuntimeUpgrade functions
ggwpez Sep 21, 2022
8445446
fix test
ggwpez Sep 21, 2022
976f0c5
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
Sep 27, 2022
29c56c4
Fix BoundedSlice::truncate_from
ggwpez Sep 27, 2022
0e90699
Fix pre_upgrade hook return values
ggwpez Sep 27, 2022
a31a134
Add more error logging
ggwpez Sep 27, 2022
c8df546
Find too large preimages in the pre_upgrade hook
ggwpez Sep 27, 2022
9af2704
Test that too large Calls in agendas are ignored
ggwpez Sep 27, 2022
298b05b
Use new OnRuntimeUpgrade hooks
ggwpez Sep 27, 2022
8b177a2
works fine - just more logs
ggwpez Sep 27, 2022
e236364
Fix staking migration
ggwpez Sep 27, 2022
03e1dea
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
Sep 29, 2022
af9c6c0
Merge remote-tracking branch 'origin/master' into gav-no-stored-call
ggwpez Sep 30, 2022
9ff37ef
Fix UI tests
ggwpez Sep 30, 2022
13c6993
Remove multisig's Calls (#12072)
gavofyork Sep 30, 2022
f3598ac
Fix test
ggwpez Sep 30, 2022
c600414
Fix multisig benchmarks
ggwpez Sep 30, 2022
12cedf1
Merge branch 'master' of https://github.com/paritytech/substrate into…
Oct 3, 2022
1e02f7d
".git/.scripts/bench-bot.sh" pallet dev pallet_democracy
Oct 3, 2022
3ab1ecf
Merge branch 'master' of https://github.com/paritytech/substrate into…
Oct 3, 2022
b53d4b3
".git/.scripts/bench-bot.sh" pallet dev pallet_scheduler
Oct 3, 2022
8d66549
".git/.scripts/bench-bot.sh" pallet dev pallet_preimage
Oct 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 7 additions & 9 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,6 @@ impl pallet_proxy::Config for Runtime {
parameter_types! {
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
RuntimeBlockWeights::get().max_block;
// Retry a scheduled item every 10 blocks (1 minute) until the preimage exists.
pub const NoPreimagePostponement: Option<u32> = Some(10);
}

impl pallet_scheduler::Config for Runtime {
Expand All @@ -351,11 +349,10 @@ impl pallet_scheduler::Config for Runtime {
type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type MaxScheduledPerBlock = ConstU32<50>;
type MaxScheduledPerBlock = ConstU32<512>;
type WeightInfo = pallet_scheduler::weights::SubstrateWeight<Runtime>;
type OriginPrivilegeCmp = EqualPrivilegeOnly;
type PreimageProvider = Preimage;
type NoPreimagePostponement = NoPreimagePostponement;
type Preimages = Preimage;
}

parameter_types! {
Expand All @@ -370,7 +367,6 @@ impl pallet_preimage::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>;
type MaxSize = PreimageMaxSize;
type BaseDeposit = PreimageBaseDeposit;
type ByteDeposit = PreimageByteDeposit;
}
Expand Down Expand Up @@ -854,6 +850,7 @@ impl pallet_referenda::Config for Runtime {
type UndecidingTimeout = UndecidingTimeout;
type AlarmInterval = AlarmInterval;
type Tracks = TracksInfo;
type Preimages = Preimage;
}

impl pallet_referenda::Config<pallet_referenda::Instance2> for Runtime {
Expand All @@ -873,6 +870,7 @@ impl pallet_referenda::Config<pallet_referenda::Instance2> for Runtime {
type UndecidingTimeout = UndecidingTimeout;
type AlarmInterval = AlarmInterval;
type Tracks = TracksInfo;
type Preimages = Preimage;
}

impl pallet_ranked_collective::Config for Runtime {
Expand Down Expand Up @@ -901,7 +899,6 @@ parameter_types! {
}

impl pallet_democracy::Config for Runtime {
type Proposal = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
Expand Down Expand Up @@ -941,14 +938,15 @@ impl pallet_democracy::Config for Runtime {
// only do it once and it lasts only for the cool-off period.
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
type CooloffPeriod = CooloffPeriod;
type PreimageByteDeposit = PreimageByteDeposit;
type OperationalPreimageOrigin = pallet_collective::EnsureMember<AccountId, CouncilCollective>;
type Slash = Treasury;
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = ConstU32<100>;
type WeightInfo = pallet_democracy::weights::SubstrateWeight<Runtime>;
type MaxProposals = MaxProposals;
type Preimages = Preimage;
type MaxDeposits = ConstU32<100>;
type MaxBlacklisted = ConstU32<100>;
}

parameter_types! {
Expand Down
2 changes: 1 addition & 1 deletion frame/bounties/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
value: BalanceOf<T, I>,
) -> DispatchResult {
let bounded_description: BoundedVec<_, _> =
description.try_into().map_err(|()| Error::<T, I>::ReasonTooBig)?;
description.try_into().map_err(|_| Error::<T, I>::ReasonTooBig)?;
ensure!(value >= T::BountyValueMinimum::get(), Error::<T, I>::InvalidValue);

let index = Self::bounty_count();
Expand Down
2 changes: 1 addition & 1 deletion frame/contracts/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ where
let queue: Vec<DeletedContract> = (0..T::DeletionQueueDepth::get())
.map(|_| DeletedContract { trie_id: TrieId::default() })
.collect();
let bounded: BoundedVec<_, _> = queue.try_into().unwrap();
let bounded: BoundedVec<_, _> = queue.try_into().map_err(|_| ()).unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

why do we map error and then unwrap?

<DeletionQueue<T>>::put(bounded);
}
}
2 changes: 1 addition & 1 deletion frame/conviction-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Err(i) => {
votes
.try_insert(i, (poll_index, vote))
.map_err(|()| Error::<T, I>::MaxVotesReached)?;
.map_err(|_| Error::<T, I>::MaxVotesReached)?;
},
}
// Shouldn't be possible to fail, but we handle it gracefully.
Expand Down
7 changes: 5 additions & 2 deletions frame/democracy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ frame-system = { version = "4.0.0-dev", default-features = false, path = "../sys
sp-io = { version = "6.0.0", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "6.0.0", default-features = false, path = "../../primitives/runtime" }
sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" }
sp-core = { version = "6.0.0", default-features = false, path = "../../primitives/core" }
log = { version = "0.4.17", default-features = false }

[dev-dependencies]
pallet-balances = { version = "4.0.0-dev", path = "../balances" }
pallet-scheduler = { version = "4.0.0-dev", path = "../scheduler" }
sp-core = { version = "6.0.0", path = "../../primitives/core" }
pallet-preimage = { version = "4.0.0-dev", path = "../preimage" }

[features]
default = ["std"]
Expand All @@ -42,11 +44,12 @@ std = [
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"sp-core/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime"]
try-runtime = ["frame-support/try-runtime",]
Loading