Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Changed the Nonce to be uint256 #35

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

xgreenx
Copy link
Contributor

@xgreenx xgreenx commented Mar 20, 2023

It is code freeze, so I'm not sure where we need to merge it=) I created it not to forget because fuel-core expects that after FuelLabs/fuel-core#1052

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (code-freeze-beta4@16d19c5). Click here to learn what that means.
The diff coverage is n/a.

@@                  Coverage Diff                  @@
##             code-freeze-beta4       #35   +/-   ##
=====================================================
  Coverage                     ?   100.00%           
=====================================================
  Files                        ?         7           
  Lines                        ?       139           
  Branches                     ?        40           
=====================================================
  Hits                         ?       139           
  Misses                       ?         0           
  Partials                     ?         0           
Flag Coverage Δ
unittests 100.00% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@pixelcircuits pixelcircuits left a comment

Choose a reason for hiding this comment

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

We originally had this as a uint64 in order to have it packed more tightly along with amount, but that's no longer the case now that we've since made nonce indexed

@pixelcircuits pixelcircuits merged commit 247e4b7 into code-freeze-beta4 Mar 21, 2023
@pixelcircuits pixelcircuits deleted the feature/uint256-nonce branch March 21, 2023 02:16
xgreenx added a commit to FuelLabs/fuel-core that referenced this pull request Mar 22, 2023
Fixes #946 

This PR also uses the latest `fuel-vm` with
FuelLabs/fuel-vm#373.

- Updated the code to use named input types.
- Removed the usage of the `MessageId` from all places except the
`BlockHeader` and related to the block stuff.
- Used `Nonce` as a primary key for messages instead of `MessageId`.
Because of it, we don't need `CheckedMessage` anymore. Also, several
tests failed because the nonce was the same.
- Updated the `Nonce` from `u64` to 32 bytes. Updated the ABI to use
`uint256` instead of `uint64` -
FuelLabs/fuel-v2-contracts#35
- Renamed `Resources` into `Coins`. Renamed all comments and GraphQL
API. Moved `coin.rs` and `resource.rs` into one `coins.rs`.
- Fixed some tests for FuelLabs/fuel-vm#377 not
to increase the `HP`.
- Removed usage of the `Output::Message`.
- Renamed `message_output_count` - > `message_receipt_count` and
`message_output_root` -> `message_receipt_root`

And the main feature of why this change was created(implemented by
several lines):
`MessageData` aren't marked as spent unless included in a successfully
executed script tx

---------

Co-authored-by: Voxelot <brandonkite92@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants