-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Availability/Extrinsic store #465
Conversation
gnunicorn
left a comment
There was a problem hiding this 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.availability = | ||
| statements.extrinsic = Some(extrinsic); | ||
| statements.availability = | ||
| Some(GenericStatement::Available(hash)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap unnecessary now.
| 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we wrap this?
| log = "0.3" | ||
| substrate-codec = { path = "../../substrate/codec" } | ||
| substrate-primitives = { path = "../../substrate/primitives" } | ||
| kvdb = { git = "https://github.com/paritytech/parity.git" } |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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).
dvdplm
left a comment
There was a problem hiding this 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<()> { |
There was a problem hiding this comment.
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?
Also fix the weird file structure by making `wasm_executor.rs` -> `wasm_executor/mod.rs`.
* Add renominate * Add tests for renominate * Build wasm * Add renominate in fee * Nit
…branch Switch to upstream merkle tree library revision
* scripts: Generate changelog Signed-off-by: Alexandru Vasile <[email protected]> * scripts: Remove git tag verification Signed-off-by: Alexandru Vasile <[email protected]> * scripts: Add usage example Signed-off-by: Alexandru Vasile <[email protected]> * Update releasing steps to automate the changelog commits Signed-off-by: Alexandru Vasile <[email protected]>
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).