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

Availability/Extrinsic store #465

Merged
merged 12 commits into from
Aug 6, 2018
Merged

Availability/Extrinsic store #465

merged 12 commits into from
Aug 6, 2018

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Jul 31, 2018

Closes #371

Introduces an availability store. Validators who are meant to guarantee available data will not cast votes until the data has been written to disk. Currently it resides in a fixed subdirectory of the general data directory, but we will make it configurable in the future.

Block data network requests are now answered from the store if not kept in memory already.
There is no protocol for discovering peer IDs for validators who have historic data available (yet).

@rphmeier rphmeier added the A3-in_progress Pull request is in progress. No review needed at this stage. label Jul 31, 2018
@rphmeier rphmeier changed the title Availability store Availability/Extrinsic store Jul 31, 2018
@rphmeier rphmeier added A0-please_review Pull request needs code review. A3-in_progress Pull request is in progress. No review needed at this stage. and removed A3-in_progress Pull request is in progress. No review needed at this stage. A0-please_review Pull request needs code review. labels Aug 2, 2018
@rphmeier rphmeier added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Aug 3, 2018
Copy link
Contributor

@gnunicorn gnunicorn left a comment

Choose a reason for hiding this comment

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

Some minor style/wrapping thingies (which I wouldn't have to state if we used a tool like ...you know... rustfmt ;p )

self.inner.produced_statements.extrinsic = Some(extrinsic);
self.inner.produced_statements.availability =
statements.extrinsic = Some(extrinsic);
statements.availability =
Some(GenericStatement::Available(hash));
Copy link
Contributor

Choose a reason for hiding this comment

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

wrap unnecessary now.

) -> Service
where
A: LocalPolkadotApi + Send + Sync + 'static,
C: BlockchainEvents<Block> + ChainHead<Block> + bft::BlockImport<Block> + bft::Authorities<Block> + Send + Sync + 'static,
C: BlockchainEvents<Block> + ChainHead<Block> + BlockBody<Block> + bft::BlockImport<Block> + bft::Authorities<Block> + Send + Sync + 'static,
Copy link
Contributor

Choose a reason for hiding this comment

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

can we wrap this?

@gnunicorn gnunicorn merged commit 13de16f into master Aug 6, 2018
log = "0.3"
substrate-codec = { path = "../../substrate/codec" }
substrate-primitives = { path = "../../substrate/primitives" }
kvdb = { git = "https://github.com/paritytech/parity.git" }
Copy link
Contributor

Choose a reason for hiding this comment

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

The kvdb* crates are in parity-common now.

fn extract_io_err(err: ::kvdb::Error) -> io::Error {
match err {
::kvdb::Error(::kvdb::ErrorKind::Io(io_err), _) => io_err,
::kvdb::Error(::kvdb::ErrorKind::Msg(msg), _) => io::Error::new(
Copy link
Contributor

Choose a reason for hiding this comment

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

These errors are gone and replaced (in parity-ethereum) by plain io::Error. PR

pub fn new(config: Config) -> io::Result<Self> {
let mut db_config = DatabaseConfig::with_columns(Some(columns::NUM_COLUMNS));
db_config.memory_budget = config.cache_size;
db_config.wal = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

This option is also gone (always true now).

Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

lgtm

}

/// Make some data available provisionally.
pub fn make_available(&self, data: Data) -> io::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

What's wrong with fetch or get?

dvdplm added a commit that referenced this pull request Aug 7, 2018
* master:
  Fix some formatting grumbles (#501)
  remove the extra ? in the license header (#500)
  NetworkService::new starts the network (#462)
  Availability/Extrinsic store (#465)
  Add doc to install a specific tagged version (#497)
@arkpar arkpar deleted the rh-availability-store branch April 23, 2020 18:08
lamafab pushed a commit to lamafab/substrate that referenced this pull request Jun 16, 2020
Also fix the weird file structure by making `wasm_executor.rs` ->
`wasm_executor/mod.rs`.
liuchengxu added a commit to chainx-org/substrate that referenced this pull request Aug 23, 2021
* Add renominate

* Add tests for renominate

* Build wasm

* Add renominate in fee

* Nit
liuchengxu pushed a commit to autonomys/substrate that referenced this pull request Jun 3, 2022
…branch

Switch to upstream merkle tree library revision
helin6 pushed a commit to boolnetwork/substrate that referenced this pull request Jul 25, 2023
* scripts: Generate changelog

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* scripts: Remove git tag verification

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* scripts: Add usage example

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* Update releasing steps to automate the changelog commits

Signed-off-by: Alexandru Vasile <alexandru.vasile@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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Availability of parachain data
3 participants