Skip to content
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

Migrate to Cairo 2.1.0 #675

Merged
merged 35 commits into from
Aug 5, 2023
Merged

Migrate to Cairo 2.1.0 #675

merged 35 commits into from
Aug 5, 2023

Conversation

tarrencev
Copy link
Contributor

@tarrencev tarrencev commented Jul 25, 2023

Resolves #559 #664

@tarrencev tarrencev force-pushed the inlinemacros branch 3 times, most recently from 49eb9a4 to 75fdb33 Compare July 25, 2023 20:56
@tarrencev tarrencev marked this pull request as ready for review July 27, 2023 21:03
crates/katana/core/src/backend/transaction.rs Outdated Show resolved Hide resolved
crates/katana/core/src/backend/transaction.rs Outdated Show resolved Hide resolved
crates/katana/core/src/util.rs Outdated Show resolved Hide resolved
crates/katana/core/src/util.rs Outdated Show resolved Hide resolved
@@ -188,10 +188,10 @@ fn convert_deploy_account_to_rpc_tx(
fn convert_invoke_to_rpc_tx(transaction: ApiInvokeTransaction) -> InvokeTransaction {
match transaction {
ApiInvokeTransaction::V0(tx) => InvokeTransaction::V0(InvokeTransactionV0 {
nonce: tx.nonce.0.into(),
nonce: FieldElement::ZERO,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kariy need to update this

@shramee shramee mentioned this pull request Aug 3, 2023
shramee added 2 commits August 4, 2023 06:01
* Return when the target path already exists

* Add packages to compile
@shramee shramee mentioned this pull request Aug 4, 2023
@shramee
Copy link
Contributor

shramee commented Aug 4, 2023

@tarrencev @kariy

Updates

  1. rust-fmt
  2. Return when the target path doesn't exists
  3. Pass vec[packages] to scarb::ops::compile
    • This is fixed for all scarb::ops::compile calls in dojo.

Now it's building, but 2 tests are failing,

  1. test_component: class hash mismatch
thread 'contract::component::test::test_component' panicked at 
  assertion failed: `(left == right)`
   left: `FieldElement { inner: 0x02da8fb6056624dd6fa7070497350a13914a21e2a53f171271f72721c5448912 }`,
   right: `FieldElement { inner: 0x042e9aac8d3d6e6185815f891a5fa3b442e86e2bef3bca3ac620744309af7fe7 }`,
in crates/dojo-client/src/contract/component_test.rs:28:5
  1. test_system: spawn.dependencies unwrap panic.
thread 'contract::system::test::test_system' panicked at
  called `Result::unwrap()` on an `Err` value:
    ReaderError(ContractReaderError(ProviderError(StarknetError(ContractError)))),
in crates/dojo-client/src/contract/system_test.rs:27:59

For #675
Makes sense for class hash to be changed coz compiled code is now different.
@tarrencev
Copy link
Contributor Author

For failure 1, that is expected since the bytecode changed. We can update the expected class hash to match the new output

@kariy
Copy link
Member

kariy commented Aug 4, 2023

btw seems like the rust_fmt script is broken... because the fmt rules we're using are available only on nightly but we're using the stable channel. Which was changed when we pinned the rust ver in #643

cargo fmt --check --all -- "$@"

@shramee
Copy link
Contributor

shramee commented Aug 4, 2023

@tarrencev

For failure 1, that is expected since the bytecode changed. We can update the expected class hash to match the new output

Aye, after fixing that, it seems like schema entrypoint is missing from Component contract.

  • Similar names replacement?

And dependencies is missing from System contract.

@kariy

btw seems like the rust_fmt script is broken...

Aah, perhaps I'm on nightly, it seemed to work for me.

@tarrencev
Copy link
Contributor Author

Ah yes, we've removed the schema method for now. We should update the logic to not use it. It was a naive implantation anyways and assumed one slot per member

@shramee
Copy link
Contributor

shramee commented Aug 4, 2023

Edited the message above with newer deets. I'll catch up later!

@kariy
Copy link
Member

kariy commented Aug 4, 2023

@tarrencev whats the reason for removing the dependencies function for system? is it related to the removal of schema as well?

@kariy kariy force-pushed the inlinemacros branch 2 times, most recently from 29ccca4 to ce6bdb2 Compare August 4, 2023 04:00
@tarrencev
Copy link
Contributor Author

@tarrencev whats the reason for removing the dependencies function for system? is it related to the removal of schema as well?

The way that we were extracting dependencies was creating syntactical constraints, it's the reason we always needed to pass a struct constructor to set, so I removed it for now. We'll add it back in the future. schema was also half baked, i'll add it back with the new codegen soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor Inline Macros for Global Availability
3 participants