-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
Could use a rebase. This is 3 PRs worth of commits! edit: correction: 4. There are 2 of my Runtime API PRs from last week in here |
@@ -169,6 +171,12 @@ async fn get_core_availability( | |||
Ok(false) | |||
} | |||
|
|||
// delegates to the v1 runtime API | |||
async fn get_availability_cores(_relay_parent: Hash, _sender: &mut mpsc::Sender<FromJob>) -> Result<Vec<CoreState>, Error> { |
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.
I realized this later, but another way to stub this out would be to add the variant to the RuntimeApiRequest
in the subsystem
crate.
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.
I like that idea; 146746c.
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.
Fixes LGTM, maybe we can avoid the unimplemented!
with the method I suggested
- use CoreState, not CoreOccupied - query for availability chunks, not the whole PoV - create a stub `fn availability_cores`
64d8e69
to
146746c
Compare
Rebasing dramatically simplifies this PR, it turns out. |
An interesting fact: the failing test,
|
…ng-fixes Note: sorted the imports in messages.rs because it was getting difficult to determine what the true diffs were by eye.
This test appears to have become flaky at some point before or during #1469: the master-merge for that PR failed CI, as did the master-merge for #1445. In both of those cases, the test succeeded on the final commit before the squash-merge. However, three other master-merge CI runs in that span succeeded. It's not obvious to me how the test is supposed to work, or why it's sometimes failing. The obvious suspicion is that the @rphmeier AFAICT you're the person who has the best chance of understanding this issue; what's your take on it? |
^^^^ Also saw this thing with the test on some CI runs, but atm it is not failing with this test. Probably fixing the build could help |
node/subsystem/src/messages.rs
Outdated
AvailableData, | ||
BackedCandidate, | ||
BlockNumber, | ||
CandidateDescriptor, | ||
CandidateEvent, | ||
CandidateReceipt, | ||
CommittedCandidateReceipt, | ||
CoreAssignment, | ||
CoreOccupied, | ||
CoreState, | ||
ErasureChunk, | ||
Hash, | ||
HeadData, | ||
Id as ParaId, | ||
OmittedValidationData, | ||
PoV, | ||
SignedAvailabilityBitfield, | ||
SigningContext, | ||
ValidationCode, | ||
ValidatorId, | ||
ValidatorIndex, | ||
ValidatorSignature, |
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.
Not sure if thats ok; if that's the IDE sorting imports (rust-analyzer can do that I think) could that at least not do the one-per-line thing?
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.
I did that intentionally: I was having trouble diffing the imports when resolving a merge conflict in which people added and removed various items in different places. Using one per line, alphabetically, made it much easier to sort things out.
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.
It would be better to have them be more compact. We don't use this style anywhere else.
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.
As a question of policy, I'd prefer to leave them like this, and expand the use of this style. Rationale: the vast majority of the time, we're not looking at the import lines, but elsewhere in the file. Of the times we are in fact looking at the import lines, it's when adding or merging imports; in those times, it's faster when the lists are broad and alphabetical than when using basically any other taxonomy.
Nevertheless, 8e5c6da.
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.
Maybe the general rule should be to merge all crates import into one import, after that the compiler will ensure that you don't have duplicates in this list.
/// This is useful in cases like bitfield signing, when existence | ||
/// matters, but we don't want to necessarily pass around large | ||
/// quantities of data to get a single bit of information. | ||
QueryChunkAvailability(Hash, ValidatorIndex, oneshot::Sender<bool>), |
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.
I had serious doubts as I was adding QueryDataAvaialbility
message; is it really better for performance? We anyway lift one big blob from disk, there is no way to ask kvdb
for just availability; when we send whatever data struct that's containing the pointer to this blob, only it will be sent around, wouldn't it?
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.
At worst, it masks a kvdb
limitation which can be fixed in the future.
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 passed, this time, but I do think we should resolve #1474 eventually. |
@rphmeier I got a LGTM 5 days ago; could I get a formal approval so we can merge this PR please? |
bot merge |
Trying merge. |
* master: Candidate Validation Subsystem (#1432) reduce slash defer durations (#1504) Implement the Runtime API subsystem (#1494) Companion for #6610 (Balances Weight Trait) (#1425) [CI] Publish draft release redux (#1493) Update README docs related to local build (#1479) Add a default trie-memory-tracker feature to the cli (#1502) Companion PR for `Add a `DefaultQueue` type alias to remove the need to use `sp_api::TransactionFor`` (#1499) Fix bitfield signing (#1466) Update Substrate, bump versions, clean up sort (#1496) Bump Substrate
Fixes the problems with #1364, which was merged too soon.