Skip to content

Commit

Permalink
add beefy compact signed commitment definition (#5781)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
mfornos and github-actions[bot] authored Jan 26, 2024
1 parent 5374f84 commit a64228c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/types-augment/src/registry/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interface
import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeGenesisConfiguration, BabeGenesisConfigurationV1, BabeWeight, Epoch, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, OpaqueKeyOwnershipProof, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe';
import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
import type { BeefyAuthoritySet, BeefyCommitment, BeefyEquivocationProof, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, BeefyVersionedFinalityProof, BeefyVoteMessage, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
import type { BeefyAuthoritySet, BeefyCommitment, BeefyCompactSignedCommitment, BeefyEquivocationProof, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefyPayloadId, BeefySignedCommitment, BeefyVersionedFinalityProof, BeefyVoteMessage, MmrRootHash, ValidatorSet, ValidatorSetId } from '@polkadot/types/interfaces/beefy';
import type { BenchmarkBatch, BenchmarkConfig, BenchmarkList, BenchmarkMetadata, BenchmarkParameter, BenchmarkResult } from '@polkadot/types/interfaces/benchmark';
import type { CheckInherentsResult, InherentData, InherentIdentifier } from '@polkadot/types/interfaces/blockbuilder';
import type { BridgeMessageId, BridgedBlockHash, BridgedBlockNumber, BridgedHeader, CallOrigin, ChainId, DeliveredMessages, DispatchFeePayment, InboundLaneData, InboundRelayer, InitializationData, LaneId, MessageData, MessageKey, MessageNonce, MessagesDeliveryProofOf, MessagesProofOf, OperatingMode, OutboundLaneData, OutboundMessageFee, OutboundPayload, Parameter, RelayerId, UnrewardedRelayer, UnrewardedRelayersState } from '@polkadot/types/interfaces/bridges';
Expand Down Expand Up @@ -153,6 +153,7 @@ declare module '@polkadot/types/types/registry' {
BalanceStatus: BalanceStatus;
BeefyAuthoritySet: BeefyAuthoritySet;
BeefyCommitment: BeefyCommitment;
BeefyCompactSignedCommitment: BeefyCompactSignedCommitment;
BeefyEquivocationProof: BeefyEquivocationProof;
BeefyId: BeefyId;
BeefyKey: BeefyKey;
Expand Down
8 changes: 7 additions & 1 deletion packages/types/src/interfaces/beefy/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,20 @@ export default {
first: 'BeefyVoteMessage',
second: 'BeefyVoteMessage'
},
BeefyCompactSignedCommitment: {
commitment: 'BeefyCommitment',
signaturesFrom: 'Vec<u8>',
validatorSetLen: 'u32',
signaturesCompact: 'Vec<EcdsaSignature>'
},
BeefySignedCommitment: {
commitment: 'BeefyCommitment',
signatures: 'Vec<Option<EcdsaSignature>>'
},
BeefyVersionedFinalityProof: {
_enum: {
V0: 'Null',
V1: 'BeefySignedCommitment'
V1: 'BeefyCompactSignedCommitment'
}
},
BeefyNextAuthoritySet: {
Expand Down
10 changes: 9 additions & 1 deletion packages/types/src/interfaces/beefy/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ export interface BeefyCommitment extends Struct {
readonly validatorSetId: ValidatorSetId;
}

/** @name BeefyCompactSignedCommitment */
export interface BeefyCompactSignedCommitment extends Struct {
readonly commitment: BeefyCommitment;
readonly signaturesFrom: Bytes;
readonly validatorSetLen: u32;
readonly signaturesCompact: Vec<EcdsaSignature>;
}

/** @name BeefyEquivocationProof */
export interface BeefyEquivocationProof extends Struct {
readonly first: BeefyVoteMessage;
Expand Down Expand Up @@ -53,7 +61,7 @@ export interface BeefySignedCommitment extends Struct {
export interface BeefyVersionedFinalityProof extends Enum {
readonly isV0: boolean;
readonly isV1: boolean;
readonly asV1: BeefySignedCommitment;
readonly asV1: BeefyCompactSignedCommitment;
readonly type: 'V0' | 'V1';
}

Expand Down

0 comments on commit a64228c

Please sign in to comment.