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

fix: hive #1381

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

fix: hive #1381

wants to merge 20 commits into from

Conversation

greged93
Copy link
Collaborator

Time spent on this PR: 1 day

On track for: #1310

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Testing

What is the new behavior?

Fixes the hive testing using execute from outside.

Does this introduce a breaking change?

  • Yes
  • No


// Set the chain id
let chain_id = starknet_provider.chain_id().await?;
let chain_id: u64 = (Felt::from(u64::MAX).to_bigint() & chain_id.to_bigint()).try_into()?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here, shouldn't it be:

let chain_id: u64 = (Felt::from(u32::MAX).to_bigint() & chain_id.to_bigint()).try_into()?;

to be consistent with what's here

let chain = (starknet_provider.chain_id().await.map_err(KakarotError::from)?.to_bigint()
& Felt::from(u32::MAX).to_bigint())
.to_u64()
.unwrap();
?

Copy link
Collaborator Author

@greged93 greged93 Sep 17, 2024

Choose a reason for hiding this comment

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

you're right, as discussed this is an error in the code and needs to be fixed. We should split into one ETH_CHAIN_ID which is taken modulo u32::MAX and one STARKNET_CHAIN_ID which is just the "real" starknet chain id

Copy link
Member

@ClementWalter ClementWalter Sep 23, 2024

Choose a reason for hiding this comment

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

2**53 and not 2**32 though

@greged93 greged93 force-pushed the fix/hive branch 2 times, most recently from 45a1535 to d12b596 Compare September 18, 2024 10:49
@tcoratger tcoratger mentioned this pull request Sep 20, 2024
@greged93 greged93 force-pushed the fix/hive branch 4 times, most recently from e6d271b to e98e60c Compare September 25, 2024 08:07
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.

3 participants