-
Notifications
You must be signed in to change notification settings - Fork 39
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
Implement get_tipset_cid #568
Conversation
ebfd26b
to
72b8033
Compare
340b854
to
70c8d99
Compare
bceae76
to
e72eb8c
Compare
a982ef3
to
0e38cc8
Compare
9963a80
to
c34424f
Compare
Also move the fil_actors_runtime as an optional dependency that is only required when fil-actor feature is set
- create chainmetadata module actor_interface - identify custom actors by name and skip code id
Instead we return the same blockhash as was added, and then we let the caller deal with converting to cid.
6eca89b
to
ee3e823
Compare
//uint256 number = uint256(blockhash(block.number - 1)); | ||
bytes32 myHash = blockhash(block.number - 1); | ||
|
||
return string(abi.encodePacked(myHash)); |
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.
This will fail another integration test, namely this one called from here.
I can imagine it has been committed by mistake, but just to clarify, what I thought would be a nice integration test for this is to add a contract very similar to Greeter.sol
to testing/contracts
that has a function to return the e.g. BLOCKHASH(1)
, then add an example right next to greeter.rs
which is again very similar in that it deploys this contract, then calls it similar to how that one calls greet()
, and finally retrieves the block by height to compare the hash against what the contract returned.
The Greeter
contract should be left alone to avoid any confusion as it was taken verbatim from another repo where it served the same purpose of testing The Graph.
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.
sorry, this was accidentally committed, it was just what I used for testing
Working on fixing CI, there was some issue when rebasing, and now getting cargo errors failing to select a version for a package |
58c2aef
to
2386c7d
Compare
The fix was to removing "crypto" feature from fvm_shared dependency in contracts/binding/Cargo.toml, recompile, and then add it back.
# We can work around it by hardcoding the method hashes; currently there is only one. | ||
# frc42_dispatch = "3.2" | ||
# We need a version of frc42_dispatch that has been updated to use FVM 4.1 | ||
frc42_dispatch = { git = "https://github.com/fridrik01/filecoin.git", branch = "update-fvm-4.1" } |
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.
Note, that I needed to fork this repo to update it to FVM 4.1. I have a PR for merging this into the official repo (filecoin-project/actors-utils#231)
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.
Great! I'm not sure why Greeter.bin
changes, but as long as CI passes, let's go!
See #508
TODO:
push_blockcid
individually.get_tipset_cid
syscall by callingChainMetadata::blockcid()
Follow up tasks