-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix https://github.com/status-im/nim-beacon-chain/issues/944 #955
Conversation
well, couldn't a signed block have the same issue? also, doesn't the spec determin in which order things are checked? if yes, we should probably be doing it in the spec order? there are checks around saying we shouldn't consider blocks from the future anyway so I'm a bit hesitant to apply just like that... |
Yes, a signed block could. Then one would be left with a block with invalid attestations that according to the spec, wouldn't be detected for quadrillions of slots. prysmaticlabs/prysm#5658 (comment) makes this point well, quoting the spec state transition pseudocode, and:
Even without this fix, once
|
This is akin to #922 / #927 which shows another example of where I'd be fine with not merging this, too, but the class of fuzzed issues, real insofar as they can be reproduced, but probably not achievable (because they require an invalid beacon state and/or requiring bypassing checks which exist in the spec, but not in the |
A final reply, to address:
Specifically. Yes, there are checks, for example, in
Which reflects https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/specs/phase0/p2p-interface.md#global-topics saying:
But by following the beacon chain state transition function specification as we do, a tool which directly calls |
I guess the issue with those checks is that they depend on the local clock, making them unsuitable for "hard" logic like the one in |
another way to put this: in ncli, as a matter of quality of implementation, it would perhaps make sense to have a tolerance parameter, because as far as testing tools go, it could be useful to try to apply some valid crazy future blocks just to see what happens (with rewards for example). |
Would this imply also having |
My couple cents:
Agreed, sounds a very valid concern. For reasonable performance, we should also be limitting the number of slots needing to be processed. For consistency and predictable behavior, I would advocate for If extra checks end up being necessary, I'd think it preferable to run it as a separate ncli endpoint so there's less confusion about what the command actually does. |
hm, this is a tricky one - the more the fuzzing inputs are "constrained", the less resilient the state transition itself becomes against odd cases and we might miss some combination of parameters - ie one of the benefits of fuzzing is that even if there are bugs in other layers, what gets through to the transition is handled "gracefully". Based on fuzzing findings, would it make sense to put some additional checks in the transition function itself? |
Definitely a concern. It's a false positive/false negative tradeoff.
Primarily, I'd like whatever the fixes are to be consistent across clients, so that each client doesn't contort their transition functions in slightly different ways which subtly differ from the spec to create interop issues in a testnet or mainnet. So my specific proposal:
|
This isn't meant to close any future discussion, but closing this issue, because I'm not going to merge this particular PR. |
prysmaticlabs/prysm#5658 has more extensive discussion of this. Consensys/teku#1693 shows one example of a fix, not the same one as here.
There's so much off with this block -- it requests an absurd slot in the 10^15 range, its attestations aren't correct, and its signature is incorrect.
The other fixes mostly target the attestations, but those appear to be an artifact of the
zcli
-type tools bypassing the usual verification pathways, and fixing that wouldn't really make thebeacon_node
pathways any more robust. So, instead, do something else useful, and move the block signature check earlier. There's a cost to this, potentially, but (a) it's supposed to be paid regardless, and (b) it's a fixed cost, instead of processing (here) 2 quadrillion slots before figuring out the signature's incorrect.The conceptual downside to the committee size-based approach is that, in theory, this regards the committees as they'll appear 2 quadrillion slots from now, not their current size, so it's easier to justify rejecting the block based on the signature.
Finally, there are obvious issues with processing blocks of unbounded length -- but they're largely an artifact of these test tools, as there should not be use cases in actual testnets or mainnets for such jumps. Could be worth guarding against.