-
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
feat: fvm: add support for looking up past tipset CIDs #9687
Conversation
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.
Yeah, this is how I would do it too.
302308a
to
93c2c10
Compare
@arajasek I've rebased on master, merge when ready. Note: this updates the FFI. Technically, we can get away with not doing that on master if you're so inclined. |
Actually, I'm just going to revert that part. |
f577166
to
2e5cfb2
Compare
@@ -98,6 +99,28 @@ func (k *TipSetKey) UnmarshalJSON(b []byte) error { | |||
return nil | |||
} | |||
|
|||
func (k TipSetKey) Cid() (cid.Cid, 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.
@arajasek cherry-picked from feat/nv18-fevm. Please review.
(cherry-picked from feat/nv18-fevm)
We do this by adding yet another "getter" to the VM that resolves an epoch into a TipSetKey.
2e5cfb2
to
2bc1abc
Compare
We do this by adding yet another "getter" to the VM that resolves an epoch into a TipSetKey.
Alternatively, we could stick this functionality on
Rand
, but then it wouldn't really be "rand" but something else...Depends on filecoin-project/filecoin-ffi#339
Merge plan:
Unfortunately, it needs to land on master because it bubbles a breaking change in the FFI (where the FVM now needs the ability to lookup tipset CIDs).
Alternatively, we could make this optional with a runtime type assertion. That is, if we find that we're using "v3" inside the FFI, we could type-assert that the "externs" supports the
TipsetCid
method. That would let us merge the FFI changes without making any changes to the interface.