Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sassafras primitives #1249

Merged
merged 14 commits into from
Aug 31, 2023
Merged

Sassafras primitives #1249

merged 14 commits into from
Aug 31, 2023

Conversation

davxy
Copy link
Member

@davxy davxy commented Aug 29, 2023

This PR introduces a new crate with the primitives required by #41.

Quoting the crate README:

The crate interfaces and structures are experimental and may be subject to changes.

Nevertheless, the strategy here is to incrementally drain the main Sassafras PR by upstreaming smaller components in order to make the overall protocol inclusion and analysis more manageable.

The structures and functions were found to satisfy the requirements of the protocol.

A more in depth analysis of the structures obviously requires to dig into the client and frame pallets in the main PR.


This crate requires to enable bandersnatch-experimental feature in some of its dependencies.

This feature ends up being transitively enabled in:
sp-consensus-sassafras → sp-application-crypto → sp-io → sp-keystore

Follows that Bandersnatch API ends up being exposed by the Keystore trait and thus we require to expose these functions implementations in the client keystore (sc-keystore) as well.

The (temporary) workaround is to include sc-keystore as an optional dependency in sp-consensus-sassafras and enable it with bandersnatch-experimental feature on std builds solution is to conditionally compile sc-keystore experimental code using the result of generate_feature_enabled_macro (see 3a1eeda)


Step towards: #41

Extracted from: paritytech/substrate#11879

Superseeds: paritytech/substrate#14768

@davxy davxy self-assigned this Aug 29, 2023
@paritytech-ci paritytech-ci requested review from a team August 29, 2023 11:06
@davxy davxy added the T0-node This PR/Issue is related to the topic “node”. label Aug 29, 2023
Copy link
Contributor

@skunert skunert left a comment

Choose a reason for hiding this comment

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

Based on your previous explanations about the flow, this looks good to me!


/// Configuration data that can be modified on epoch change.
#[derive(
Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug, MaxEncodedLen, TypeInfo, Default,
Copy link
Contributor

Choose a reason for hiding this comment

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

Creating this struct with Default will initialize everything to zero, including the attempts_number. Shouldn't that be at least 1 by default?

substrate/primitives/consensus/sassafras/src/lib.rs Outdated Show resolved Hide resolved
@davxy davxy merged commit f1f7937 into paritytech:master Aug 31, 2023
4 checks passed
@davxy davxy deleted the sassafras-primitives branch August 31, 2023 11:38
@davxy davxy mentioned this pull request Aug 31, 2023
5 tasks
ordian added a commit that referenced this pull request Aug 31, 2023
* master:
  Sassafras primitives (#1249)
  Restructure `dispatch` macro related exports (#1162)
  backing: move the min votes threshold to the runtime (#1200)
  Bump zstd from 0.11.2+zstd.1.5.2 to 0.12.4 (#1326)
  Remove `substrate_test_utils::test` (#1321)
  remove disable-runtime-api (#1328)
ordian added a commit that referenced this pull request Sep 1, 2023
* master: (25 commits)
  fix typos (#1339)
  Use bandersnatch-vrfs with locked dependencies ref (#1342)
  Bump bs58 from 0.4.0 to 0.5.0 (#1293)
  Contracts: `seal0::balance` should return the free balance (#1254)
  Logs: add extra debug log for negative rep changes (#1205)
  Added short-benchmarks for cumulus (#1183)
  [xcm-emulator] Improve hygiene and clean up (#1301)
  Bump the known_good_semver group with 1 update (#1347)
  Renames API (#1186)
  Rename `polkadot-parachain` to `polkadot-parachain-primitives` (#1334)
  Add README to project root (#1253)
  Add environmental variable to track decoded instructions (#1320)
  Fix polkadot-node-core-pvf-prepare-worker build with jemalloc (#1315)
  Sassafras primitives (#1249)
  Restructure `dispatch` macro related exports (#1162)
  backing: move the min votes threshold to the runtime (#1200)
  Bump zstd from 0.11.2+zstd.1.5.2 to 0.12.4 (#1326)
  Remove `substrate_test_utils::test` (#1321)
  remove disable-runtime-api (#1328)
  [ci] add more jobs for pipeline cancel, cleanup (#1314)
  ...
Daanvdplas pushed a commit that referenced this pull request Sep 11, 2023
* Introduce Sassafras primitives

* Keystore workaround

* Fix doc

* Use  in keystore

* Improve bandersnatch vrf docs

* Apply review suggestions

* Update README

* Docs improvement

* Docs fix
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
* Introduce Sassafras primitives

* Keystore workaround

* Fix doc

* Use  in keystore

* Improve bandersnatch vrf docs

* Apply review suggestions

* Update README

* Docs improvement

* Docs fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
bkchr pushed a commit that referenced this pull request Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T0-node This PR/Issue is related to the topic “node”.
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

5 participants