-
Notifications
You must be signed in to change notification settings - Fork 14
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(cartesi-machine): update machine bindings #102
Conversation
aa82642
to
d05e406
Compare
.expect("fail to convert input index") | ||
>= input_index_boundary | ||
{ | ||
if input_added.index >= U256::from(input_index_boundary) { |
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.
Why the index boundary have a different type?
And it might be better to convert it only once, outside the loop.
assert_data_eq( | ||
"0x4441036546894c6fcf905b48b722f6b149ec0902955a6445c63cfec478568268", | ||
// cast keccak (cast concat-hex (cast keccak "minhas") (cast keccak "bananas")) | ||
Digest::from_data("minhas".as_bytes()).join(&Digest::from_data("bananas".as_bytes())), |
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.
:-D
5b1d6b5
to
edfe2c2
Compare
I've done some work updating the machine Lua binding. Currently getting this error
EDIT: I think this is not an error exactly, just that the Sybil has the incorrect initial state, and the smart contract is rejecting it. |
acce7cf
to
8cd889b
Compare
Updated emulator version to 0.19, updated Rust bindings for new C API, updated Rust and Lua code that uses machine API. Added honeypot as a submodule, added it to the build pipeline, and added a new test target that runs integration test using honeypot. Updated CI. |
8cd889b
to
a8d3185
Compare
Sorry I just saw this. Yes the error means the agree state was wrong. Were you able to solve it? Was it a bug in the code or was it just a misconfiguration? |
adapt to new machine lua API fix one-step proof lua rework docker env add honeypot fix CI
bf58aff
to
caa1046
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.
Amazing work and great quality written tests. It's a long PR, I'm not sure if I overlook anything, but it looks great to me!
The repository includes examples for different components of Dave: | ||
|
||
- **PRT Lua Client (Compute):** | ||
Follow the instructions in the [PRT Lua client README](prt/tests/compute/README.md). |
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.
I think compute Lua v.s Rust
examples are kind of broken. After the whole rust workspace refactor, only Lua v.s Lua
example works. If you think it's a high priority, I'll start working on it.
Also, I think we should adapt just
for compute
examples as well.
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.
I agree! But let's sync later on the priority. Could you open an issue for now?
); | ||
|
||
drop(anvil); | ||
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn test_blockchain_reader() -> Result<()> { | ||
let (anvil, provider, input_box_address, consensus_address) = spawn_anvil_and_provider(); | ||
async fn test_blockchain_reader_aaa() -> Result<()> { |
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.
why adding _aaa
at the end?
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.
I have no idea what happened 😅
logs.push(&reset_logs); | ||
Ok(encode_access_logs(logs, encode_input)) | ||
} else { | ||
let step_logs = self.machine.log_uarch_step(log_type, false)?; | ||
let step_logs = self.machine.log_step_uarch(LogType::default())?; |
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.
I actually don't really understand when to set large_data
and when to set annotations
.
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.
Me neither. Here it's important to set all permutations to be sure the deserialization works.
I think for Dave we don't need either, ever. I think these are just for debugging purposes for the machine team. At least that's what they told me.
New bindings for the new C API. Current commit is using release v0.19.0-test2. I believe we should only merge this on a proper release. It's also possible to test without a release (i.e. latest main branch commit), but requires a local docker installation.
Remember to run
just clean-emulator
, since your local copy will probably have build artifacts of older versions. You need to have the local supporting files too: runjust setup
. To test, runcargo test -p cartesi-machine
.