Add runtime API for authorizations#491
Conversation
63f96aa to
ea387bf
Compare
| #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Encode, Decode, TypeInfo)] | ||
| pub struct AccountAuthorization<BlockNumber> { | ||
| /// Block at which this account's authorization expires. | ||
| pub expires_at: BlockNumber, |
There was a problem hiding this comment.
not sure if client will be able to interpret this - relay block, Bulletin para block?
There was a problem hiding this comment.
Do you want to use time? Relay chain block would be better for me, I'm vouching for that
There was a problem hiding this comment.
Do you want to use time? Relay chain block would be better for me, I'm vouching for that
Well, I don't know now, we don't use relay chain blocks, and everything is in Bulletin parachain blocks. I am not sure about the time. For now, with actual impl, I would just consider this Bulletin para block number and client could interpret this to the real clock time?
There was a problem hiding this comment.
With authorization slots, this will be relay blocks
| /// - `who` has an unexpired authorization entry | ||
| /// - per-account hard cap: `bytes_permanent + size <= bytes_allowance` | ||
| /// - chain-wide hard cap: `PermanentStorageUsed + size <= MaxPermanentStorageSize` | ||
| pub fn can_renew(who: &T::AccountId, content_hash: ContentHash) -> bool { |
There was a problem hiding this comment.
I think can_renew should also take into account the case of AUTO_RENEWAL_ALREADY_ENABLED - maybe we could extract some common "verify" method between this API and check_signed (related to renews) so these are less likely to diverge
|
If we are going the direction of |
hmm, but if we go with @karolk91 what do you suggest? |
Yeah I was thinking about something similar, to allow In addition to above, current APIs also doesn't support preimage authorizations |
Yes, agree, let's iterate
Well, yes, good point, but who can |
|
@bkontur I was thinking about ideas for the runtime API. I will make a new PR then :) |
Addresses #495
We have recently changed the
AuthorizationExtentfields with data irrelevant for most client applications. I'm adding a runtime API for returning a simpler and more stable version of authorizations for client applications to use.TODO