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

Update codec version to the 4.1 version #2948

Merged
merged 9 commits into from
Jun 26, 2019
Merged

Update codec version to the 4.1 version #2948

merged 9 commits into from
Jun 26, 2019

Conversation

stanislav-tkach
Copy link
Contributor

#2855 was accidentally merged (and reverted) before it was ready, so here is an updated version.

@stanislav-tkach stanislav-tkach added the A0-please_review Pull request needs code review. label Jun 25, 2019
@bkchr
Copy link
Member

bkchr commented Jun 25, 2019

@andresilva still has the commit in #2801 .

Copy link
Contributor

@Demi-Marie Demi-Marie left a comment

Choose a reason for hiding this comment

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

The commit message shoule explain what code changes were needed and why.

@@ -636,7 +636,7 @@ where
round: u64,
state: RoundState<Block::Hash, NumberFor<Block>>,
base: (Block::Hash, NumberFor<Block>),
votes: Vec<SignedMessage<Block>>,
votes: &HistoricalVotes<Block::Hash, NumberFor<Block>, Self::Signature, Self::Id>,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is an implementation of the Environment trait from finality-grandpa. The trait definition is changed, so the implementation needs to be updated.

Copy link
Contributor

Choose a reason for hiding this comment

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

@andresilva
Copy link
Contributor

@DarkEld3r I merged master into #2801 when master still had this change in. It's fine to merge it in this PR instead so you can keep attribution (I'll rebase and remove it from my PR once it is in). The issue is around synchronization of merges: we can't release finality-grandpa as is, we need to merge paritytech/finality-grandpa#53 first since it has breaking changes, and the changes necessary to support that exist in #2801. And we can't merge this PR because it depends on an unreleased finality-grandpa.

@gui1117
Copy link
Contributor

gui1117 commented Jun 26, 2019

also parity-codec 4.1 needs the fix of for crafted input that trigger huge allocation paritytech/parity-scale-codec#109

@gavofyork
Copy link
Member

@DarkEld3r is this good to be merged now?

@stanislav-tkach
Copy link
Contributor Author

stanislav-tkach commented Jun 26, 2019

@gavofyork I suppose it makes sense to wait a little bit more for 4.1.1 to be released (paritytech/parity-scale-codec#114).

@kianenigma
Copy link
Contributor

@gavofyork I suppose it makes sense to wait a little bit more for 4.1.1 to be released (paritytech/parity-scale-codec#114).

Updated.

@@ -6,7 +6,7 @@ description = "Generic slots-based utilities for consensus"
edition = "2018"

[dependencies]
codec = { package = "parity-codec", version = "3.2" }
codec = { package = "parity-codec", version = "4.1" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe not now but:
don't we want to put some guidelines on import names? sometimes it can be confusing. I bet you can find the crate core/sr-primitives along the code base with names:

  • primitive
  • sr-primitives
  • substrate-primitives
  • ...

Copy link
Contributor Author

@stanislav-tkach stanislav-tkach Jun 26, 2019

Choose a reason for hiding this comment

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

I like the idea, though it will be hard to apply strict rules everywhere because we have a lot of similar names (for example, "primitives").

Copy link
Contributor

@andresilva andresilva left a comment

Choose a reason for hiding this comment

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

LGTM. We will have an unreleased dependency in master (finality-grandpa), but this will be dealt with shortly after #2801 is merged.

@bkchr
Copy link
Member

bkchr commented Jun 26, 2019

Can we not change the destination branch to @andresilva's grandpa branch for #2801? Merge it into this branch and merge into master with #2801 together.

@stanislav-tkach
Copy link
Contributor Author

@gavofyork I suppose it is OK to merge now.

@bkchr bkchr merged commit d6099e9 into master Jun 26, 2019
@bkchr bkchr deleted the stas-codec-4-1 branch June 26, 2019 14:26
MTDK1 pushed a commit to bdevux/substrate that referenced this pull request Jul 10, 2019
* Update codec version to the 4.1 version

* Bump impl_version

* Update lock files

* Update codec to 4.1.1 version

* Bump impl version
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants