-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: null rounds: pass correct timestamp to the FVM. #10189
Conversation
e95b3c5
to
4810bbc
Compare
4810bbc
to
0cf3a5e
Compare
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.
So I think this doesn't have consensus impact, and if it does we'll pick that up running on mainnet pretty quick.
Tests seem validly angry, may need to change to getting timestamp from parent tipset
Failed
=== RUN TestConformance/reward/reward--ok-miners-awarded-no-premiums--tape.json/tape
runner.go:200: failed to apply tipset 0: failed to get genesis when backfilling null rounds: datastore: key not found
--- FAIL: TestConformance/reward/reward--ok-miners-awarded-no-premiums--tape.json/tape (0.00s)
(rebase should fix test-itest-fevm fails) |
That test vector is generated here. That's a synthetic test vector that advances the chain artificially by adding null rounds, to then verify that the correct reward was dispensed. Before, processing a null round didn't require accessing chain data; now it does. This would still be a problem even if we accessed just the parent, because that suite does not produce any chain data. (Similarly those suites wouldn't work with lookbacks). |
I'm afraid the only solution I can think of is to skip that test vector :-/ |
How often do we have null rounds on mainnet? We'll definitely pick up regressions on non-null rounds quickly, but not sure about the former. |
Yeah, I think skipping that test vector is fine.
Null rounds are pretty common on mainnet, but @magik6k is right that this has no consensus impact today. Definitely no impact today (timestamps aren't provided to the VM in nv17 and earlier), and cron doesn't currently use the timestamp. |
We no longer need it because specs-actors is deprecated. v7 vectors have been merged to master.
Related Issues
Fixes filecoin-project/ref-fvm#1632.
Proposed Changes
This PR calculates the correct timestamp for a null round and passes it to the FVM.
I had two choices here:
I chose the former because I consider it safer/simpler. it requires exactly two store lookups (one to the metadata store, one to the chain blockstore).
The latter should be OK as well, and may possibly require no disk lookups at all, since the parent tipset is likely to be the heaviest tipset, but it's harder to reason about and the
GetTipsetByHeight
interface is a bit messy.Happy to switch if over if folks prefer (2).
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps