-
Notifications
You must be signed in to change notification settings - Fork 2.6k
remove without_storage_info
from pallet-collective
#14355
Conversation
fn proposal_of(proposal_hash: H256) -> Option<RuntimeCall> { | ||
AllianceMotion::proposal_of(proposal_hash) | ||
fn bound_proposal(proposal: RuntimeCall) -> Result<Bounded<RuntimeCall>, DispatchError> { | ||
Preimage::bound(proposal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This emits Event::Noted { hash }
and writes to storage if not already noted.
I think there should be a method to get the bounded version without writing or emitting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can you bound it without writing it to storage?
And if it writes to storage then it should emit an event to notify the outside world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can you bound it without writing it to storage?
If the length exceeds, then compute the hash, without storing. The bound_no_store
method I was talking about in this comment.
It depends on how the bound_proposal
method is used, and as far as I remember, it is only to retrieve the value from storage.
@ggwpez benchmarks must be re-ran, but I'm not sure about how the bot works and if I'm allowed to call it. |
bot bench $ pallet dev pallet-collective |
@muraca Requester could not be detected as a member of an allowed organization. |
bot bench $ pallet dev pallet-collective |
@ggwpez https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3035256 was started for your command Comment |
Sorry I am quite busy rn, will try to take a look tomorrow. |
@ggwpez Command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we still need the ProposalsOf
map, so far no clear indication that we do.
fn proposal_of(proposal_hash: H256) -> Option<RuntimeCall> { | ||
AllianceMotion::proposal_of(proposal_hash) | ||
fn bound_proposal(proposal: RuntimeCall) -> Result<Bounded<RuntimeCall>, DispatchError> { | ||
Preimage::bound(proposal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can you bound it without writing it to storage?
And if it writes to storage then it should emit an event to notify the outside world.
@@ -89,24 +89,33 @@ impl ProposalProvider<AccountId, Hash, RuntimeCall> for AllianceProposalProvider | |||
|
|||
fn vote_proposal( | |||
who: AccountId, | |||
proposal: Hash, | |||
proposal_bounded: Bounded<RuntimeCall>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually asked Gav whether this is the intended usage of Bounded
; turns out it is not. He said it does not make sense to pass the proposal itself, but rather the hash. So we need a map again for Hash -> Bounded<Proposal>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Hash -> Bounded<Proposal>
map with a Bounded<Proposal> -> Proposal
given by pallet preimages doesn't make any sense, I'll revert to a Hash -> Proposal
inside pallet collective
Signed-off-by: muraca <[email protected]>
Signed-off-by: muraca <[email protected]>
Signed-off-by: muraca <[email protected]>
Signed-off-by: muraca <[email protected]>
Signed-off-by: muraca <[email protected]>
Signed-off-by: muraca <[email protected]>
Signed-off-by: muraca <[email protected]>
The CI pipeline was cancelled due to failure one of the required jobs. |
Addressed in #14585 |
Closes paritytech/polkadot-sdk#167
Changelog:
Voting
StorageMap by puttingBoundedVec
for ayes and nays in theVote
structMembers
storage by puttingBoundedVec
Bounded<Call>
instead ofHash
to represent callsProposal
andProposalOf
storages, everything relies now on theVote
map + preimage to store long callsVoting
is now a CountedStorageMap, to handle theMaxProposals
boundBounded<Call>
instead ofHash
Cumulus companion: cumulus#2761 here
Polkadot companion: polkadot#7400 here