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

Beefy: use VersionedFinalityProof instead of SignedCommitment #11962

Conversation

hzy1919
Copy link
Contributor

@hzy1919 hzy1919 commented Aug 2, 2022

Fixes #11838

And change BEEFY RPC public API .

polkadot companion: paritytech/polkadot#5852

polkadot address: 15wPGN5vysDW1HYWfZRjQQhv2ktpfLMMuiJNMRKcodwPfM14

@hzy1919 hzy1919 requested a review from acatangiu as a code owner August 2, 2022 13:38
Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

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

Changes look good, thank you for contributing!

There's a few nits, and an open question on whether we should also change public facing RPC API (breaking change). I think we have to do it eventually if we really want to support versioned proofs, and better to do it now before deploying to production networks.

Comment on lines 140 to 143
let stream = self.signed_commitment_stream.subscribe().map(|vfp| match vfp {
VersionedFinalityProof::V1(sc) =>
notification::EncodedSignedCommitment::new::<Block>(sc),
});
Copy link
Contributor

Choose a reason for hiding this comment

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

I would actually change the exposed RPCs too. User facing API should support versioning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll change the exposed RPCs now.

Comment on lines 120 to 122
// `VersionedFinalityProof`.
VersionedFinalityProof::V1(signed_commitment) => self
BeefyVersionedFinalityProof::<Block>::V1(signed_commitment) => self
.justification_sender
.notify(|| Ok::<_, ()>(signed_commitment))
.notify(|| Ok::<_, ()>(BeefyVersionedFinalityProof::<Block>::V1(signed_commitment)))
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to unpack here just to pack it back in V1, just directly send the justification

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I made confused here. 😄

client/beefy/src/worker.rs Outdated Show resolved Hide resolved
client/beefy/src/worker.rs Outdated Show resolved Hide resolved
client/beefy/src/worker.rs Outdated Show resolved Hide resolved
hzy1919 and others added 7 commits August 3, 2022 10:16
Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
2.Fix typos.
3.Change the exposed RPC API to support versioned proofs.
@svyatonik svyatonik added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Aug 3, 2022
Copy link
Contributor

@svyatonik svyatonik left a comment

Choose a reason for hiding this comment

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

LGTM

@acatangiu acatangiu added B5-clientnoteworthy and removed B0-silent Changes should not be mentioned in any release notes labels Aug 3, 2022
Copy link
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Please add to the PR description the fact that BEEFY RPC API changed and should be included in release notes.

@hzy1919
Copy link
Contributor Author

hzy1919 commented Aug 3, 2022

Looks good, thanks!

Please add to the PR description the fact that BEEFY RPC API changed and should be included in release notes.

Ok . Done.

@acatangiu acatangiu merged commit 317808a into paritytech:master Aug 4, 2022
@acatangiu
Copy link
Contributor

@hzy1919 thanks for contributing! you can add a polkadot address for a tip

@acatangiu
Copy link
Contributor

bot merge

@paritytech-processbot
Copy link

Error: Github API says #11962 is not mergeable

@hzy1919
Copy link
Contributor Author

hzy1919 commented Aug 4, 2022

@hzy1919 thanks for contributing! you can add a polkadot address for a tip

@acatangiu You're welcome . I have added my polkadot address in the PR description.

@acatangiu
Copy link
Contributor

/tip small

@substrate-tip-bot
Copy link

@acatangiu You are not allowed to request a tip. Only shawntabrizi, gavofyork, rphmeier, athei, andresilva, arkpar, bkchr, eskimor, drahnr, dvdplm, robbepop, cmichi, tomaka, pepyakin, tomusdrw, kianenigma, jacogr are allowed.

@bkchr
Copy link
Member

bkchr commented Aug 4, 2022

/tip small

@substrate-tip-bot
Copy link

@bkchr A small tip was successfully submitted for hzy1919 (15wPGN5vysDW1HYWfZRjQQhv2ktpfLMMuiJNMRKcodwPfM14 on polkadot).

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.polkadot.io#/treasury/tips

DaviRain-Su pushed a commit to octopus-network/substrate that referenced this pull request Aug 23, 2022
…tech#11962)

* beefy: use VersionedFinalityProof instead of SignedCommitment.

* Change the exposed RPC API to support versioned proofs.

Co-authored-by: Adrian Catangiu <adrian@parity.io>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
…tech#11962)

* beefy: use VersionedFinalityProof instead of SignedCommitment.

* Change the exposed RPC API to support versioned proofs.

Co-authored-by: Adrian Catangiu <adrian@parity.io>
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. C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

beefy: SignedCommitment/Justification channels should use versioned struct
4 participants