Skip to content

Commit

Permalink
Important TODO about making sure every expected inherent is present (…
Browse files Browse the repository at this point in the history
…and no extras).
  • Loading branch information
Joshy Orndorff committed Oct 10, 2023
1 parent d5b405f commit dd5cb36
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tuxedo-core/src/executive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,15 @@ impl<
}

pub fn check_inherents(block: B, data: InherentData) -> sp_inherents::CheckInherentsResult {
//TODO We haven't actually made sure that all the inehrents that are expected to be in the block are indeed present.
// We could require each inherent to check this on its own. That's what FRAME does, but FRAME also allows multiple inherents per block
// Or we could do something like an accumulator. Actually, using an accumulator still requires the piece author to use the right accumulator and enforce it.
// For timestamp (and probably others) we can do this by storing not only the time, but also the block in which it is set.
// Then when we try to update it, we just make sure that the block in which it was last set is not the current block.
// Okay, but actually, maybe we can solve this a better way. The problem was taking the shortcut to a check_inherent (singular) method.
// We should stick with `check_inherents` and pass all the relevant inherents down the stack all the way to the bottom using the same wrapping and unwrapping trick.


//TODO Sanity check. I thought this needs to be mutable. But maybe giving a mutable reference is good enough?
let results = CheckInherentsResult::new();

Expand Down

0 comments on commit dd5cb36

Please sign in to comment.