During the latest spec update and code restructure we lost a lot of our block processing testing.
The objective of this issue is:
implement regression testing that ensures block processing fails when supplied an invalid parameter.
Block processing lives in the state_processing crate, specifically in the per_block_processing.rs file and per_block_processing/ dir.
Tests should be implemented in a new file: ... state_processing/src/per_block_processing/tests.rs.
The task will primarily consist of:
Result is erroneous and the Error is correct).We have a suite of "builders" in types/src/test_utils/ that are perfect for this task. For example, TestingBeaconBlockBuilder and TestingBeaconStateBuilder will produce valid blocks and states "from thin air", without needing to build a whole chain.
The best resource for learning how to use these builders is in the "old" (circa last week, before a spec update) benching code, which is presently not compiling (sorry). Particularly the BlockBenchingBuilder. I would probably start by copying the BlockBenchingBuilder and modifying it into the BlockProcessingTestBuilder (or w/e, name not well thought out).
I'm imagining this sort of flow:
let spec = ChainSpec::foundation();
let builder = BlockProcessingTestBuilder::new(...);
let (mut block, mut state) = builder.build();
state.slot = 133713
block.slot = 424242;
let result = per_block_processing(&mut state, &block, &spec);
assert_eq!(result, Err(BlockProcessingError(Invalid(BlockInvalid::StateSlotMismatch))));
_Note: this is pseudo-code. Won't compile, may have errors._
@darrenlangley I believe you're interested in this issue :)
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
__This issue now has a funding of 350.0 DAI (350.0 USD @ $1.0/DAI) attached to it.__
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
__Work has been started__.
These users each claimed they can complete the work by 2 weeks ago.
Please review their action plans below:
1) darrenlangley has been approved to start work.
I will review the block processing code for invalidity conditions (I think there are 10 on last check) and setup the scenarios for each.
Learn more on the Gitcoin Issue Details page.
@darrenlangley Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
Hi @gitcoinbot - just groking and will submit a WIP PR shortly :)
@darrenlangley Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
Hi @gitcoinbot - yes I am working on this task.
This issue is a very large piece of work so we have broken it up into the following:
_Proposer Slashing_ https://github.com/sigp/lighthouse/issues/354
_Attester Slashing_ https://github.com/sigp/lighthouse/issues/355
_Attestations_ https://github.com/sigp/lighthouse/issues/356
_Deposits_ https://github.com/sigp/lighthouse/issues/357
_Exits_ https://github.com/sigp/lighthouse/issues/358
_Transfers_ https://github.com/sigp/lighthouse/issues/359
Closing in favor of @darrenlangley's issue.
@darrenlangley Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
Hi @gitcoinbot I am still working on this.
@darrenlangley Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!
Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days
Hi @gitcoinbot I am still working on this.
Thanks @darrenlangley for keeping us posted here. We've snoozed Gitcoin Bot for 10 days here as I know you've broken this up elsewhere.
This issue is complete! @gitcoinbot you can do your magic :)
⚡️ A tip worth 350.00000 DAI (350.0 USD @ $1.0/DAI) has been granted to @darrenlangley for this issue from @ceresstation. ⚡️
Nice work @darrenlangley! Your tip has automatically been deposited in the ETH address we have on file.
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
__This Bounty has been completed.__
Additional Tips for this Bounty: