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

It is not possible to request the salt of the genesis contract #2296

Closed
xgreenx opened this issue Oct 4, 2024 · 4 comments
Closed

It is not possible to request the salt of the genesis contract #2296

xgreenx opened this issue Oct 4, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@xgreenx
Copy link
Collaborator

xgreenx commented Oct 4, 2024

Problem

Requesting salt of the genesis contracts fails because we forgot to update salt table and store this information. We need to add handling of it on the fuel-core side.

Run next query on the testnet:

query {
  contract(id: "0x7e2becd64cd598da59b4d1064b711661898656c6b1f4918a787156b8965dc83c") {
    id
    salt
    bytecode
  }
}

Definition of done

The query shouldn't fail for the testnet and any network.
The genesis process should also index contracts in the off chain database. Not only coins and messages.

@xgreenx xgreenx added the bug Something isn't working label Oct 4, 2024
@rymnc
Copy link
Member

rymnc commented Oct 9, 2024

what should the salt be for the genesis_contract? zero?

@xgreenx
Copy link
Collaborator Author

xgreenx commented Oct 9, 2024

Yep

@netrome
Copy link
Contributor

netrome commented Oct 10, 2024

@rymnc to create follow-up issue about figuring out the proper way to handle similar situations in the future.

rymnc added a commit that referenced this issue Oct 11, 2024
…iguration (#2322)

## Linked Issues/PRs
<!-- List of related issues/PRs -->
fixes #2296

## Description
<!-- List of detailed changes -->
- Implements `AsTable`, `ImportTable` for `graphql::ContractInfo` . 
- Added test to ensure that the query resolves and returns 0 for genesis
contracts.

<img width="1343" alt="image"
src="https://github.com/user-attachments/assets/b75d70a1-e8ef-4838-a8cc-d7ca511c762f">

question: this doesn't work with an existing database, can anyone point
me to the right place to include it?

I'm not sure if 8d0464e is a good idea at all.

## Checklist
- [x] Breaking changes are clearly marked as such in the PR description
and changelog
- [x] New behavior is reflected in tests
- [x] [The specification](https://github.com/FuelLabs/fuel-specs/)
matches the implemented behavior (link update PR if changes are needed)

### Before requesting review
- [x] I have reviewed the code myself
- [ ] I have created follow-up issues caused by this PR and linked them
here

### After merging, notify other teams

[Add or remove entries as needed]

- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform
documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+)
(for out-of-organization contributors, the person merging the PR will do
this)
- [ ] Someone else?

---------

Co-authored-by: Green Baneling <[email protected]>
@MitchTurner
Copy link
Member

Looks like this was solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants