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

Make $hp point to the first available byte, instead of the one before it #377

Merged
merged 10 commits into from
Mar 15, 2023

Conversation

Dentosal
Copy link
Member

@Dentosal Dentosal commented Mar 7, 2023

Closes #137

FuelVM PR: #377

Sway issue: FuelLabs/sway#4201

@Dentosal Dentosal added the fuel-vm Related to the `fuel-vm` crate. label Mar 7, 2023
@Dentosal Dentosal requested a review from a team March 7, 2023 17:06
@Dentosal Dentosal self-assigned this Mar 7, 2023
@xgreenx
Copy link
Collaborator

xgreenx commented Mar 9, 2023

We need to wait for #371 before merging this. It will introduce several new places where we need to change.

@Dentosal
Copy link
Member Author

I was trying to look through that PR but didn't really find any new changes aroun $hp. Anyway, I'll fix any issues whan that gets merged.

Dentosal added a commit to FuelLabs/fuel-specs that referenced this pull request Mar 10, 2023
@xgreenx
Copy link
Collaborator

xgreenx commented Mar 13, 2023

Tommi added usage of CheckedMemory into all places and touched something with VM_MAX_MEMORY, so I thought that maybe you have intersections =) If not, then we can merge it without waiting=)

@Dentosal Dentosal added this pull request to the merge queue Mar 15, 2023
Merged via the queue into master with commit 014af2b Mar 15, 2023
@Dentosal Dentosal deleted the make-hp-consistent branch March 15, 2023 21:50
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>
xgreenx added a commit to FuelLabs/fuel-core that referenced this pull request Apr 27, 2023
The change bumps the version to `0.18.0` and exposes
`sync_max_get_header` and `sync_max_get_txns` in the helm chart.

# Release 0.18.0

## Overview

A new release brings:
- Optimization for the execution based on the performance from beta 3
and on internal benchmarks. Improved metrics gathering.
- Stabilization and better test coverage of the `fuel-vm`. We removed
almost all unsafe code and added test cases for each opcode. Fixed some
edge cases with memory in the `fuel-vm`.
- Fully integrated Merkle trees and filled all malleable fields in the
transactions.
- Added retryable messages, removed redundant fields from it, and
updated the API to support a new commitment schema.

## What's Changed

### Breaking

- All unsafe functions were replaced with safe analog in the
`fuel-crypto` - FuelLabs/fuel-vm#346
- `$hp` holds the address of the last available byte in a heap, while
previously it was `$hp - 1` -
FuelLabs/fuel-vm#377
- Each variant in the `fuel_tx::Input` enum now has its own type -
FuelLabs/fuel-vm#364
- Message nonce is unified and now `Bytes32` everywhere -
FuelLabs/fuel-vm#394
- Removed the `message_id` field from all places -
FuelLabs/fuel-vm#397,
FuelLabs/fuel-vm#373,
- Unified the block height in all places with the introduction of a new
`BlockHeigh` - FuelLabs/fuel-vm#410
- Make SMO instruction take data ptr as an argument -
FuelLabs/fuel-vm#404
- Now the chain id affects the signature and predicate's owner and
should be passed into the `sign` function -
FuelLabs/fuel-vm#406
- Updated the `produce_blocks` endpoint to accept the start time and the
number of blocks. All new blocks will use the previous timestamp as a
base - #1059
- The `fuel-core` stores only unspent coins and messages, so all API
that previously returned spent coins is affected - Prune owned coin idx
when inputs are spent by @Voxelot in
#1055
- The message proof API has been changed to be compatible with a new
version - #1071
- The `fuel-core` now has retryable messages and coin messages.
Retryable messages can only be consumed during successful transaction
execution. The coin message acts as common coins. `resouces_to_spend`
API was replaced with `coins_to_spend` that returns a new `CoinType`
type. - #1067

## All changes
* adding fuel-core service monitor to helm chart by @rfuelsh in
#1037
* Adding specific app selector by @rfuelsh in
#1039
* use sticky sessions for GQL requests to sentries by @Voxelot in
#1042
* Add ingress service name to helm chart by @rfuelsh in
#1043
* Added test to verify the iteration over owned transactions by @xgreenx
in #1041
* Change sentry lb to use clusterIP by @Voxelot in
#1045
* Fixed Tempfile dependency by @ControlCplusControlV in
#1048
* Write contract code in raw by @freesig in
#994
* attempt to use buildjet runners by @Voxelot in
#1017
* Set tx pointer during block production by @Voxelot in
#1054
* Used `BASE_AMOUNT` for test with bob to pay for fee by @xgreenx in
#1057
* Prepare GraphQL Crate for extraction by @ControlCplusControlV in
#1012
* Support large contract deployments over p2p by @Voxelot in
#1062
* fix yaml and add linting job by @Voxelot in
#1063
* Actualized the ABI for message to be compatible with last version of
the Solidity contracts. by @xgreenx in
#1060
* feat: Contract state and assets merkle data storage by @bvrooman in
#1008
* Take into account the previous block timestamp during block production
by @xgreenx in #1059
* Prune owned coin idx when inputs are spent by @Voxelot in
#1055
* Retrayable messages fuel-core part by @xgreenx in
#1067
* chore: Additional Tests for Contract States and Balances by @bvrooman
in #1073
* Rust 1.68.1 & Sparse Registry by @Voxelot in
#1077
* Nginx tuneup by @Voxelot in
#1080
* chore: Update balance and state Merkleization by @bvrooman in
#1084
* Support sticky session in the client by @xgreenx in
#1079
* Added e2e test to run 1000 `dry_run` by @xgreenx in
#1091
* Use docker.io auth credentials to overcome rate limiting by @Voxelot
in #1092
* honeycomb tracing subscription by @Voxelot in
#1083
* Update withdrawal proof API to support proving from a block header
committed to L1 by @xgreenx in
#1071
* Upstream v0.17.8 by @Voxelot in
#1102
* use chainid for transactions and predicates by @Voxelot in
#1107
* fix the dry-run e2e test to actually perform dry runs by @Voxelot in
#1111
* peer reputation with separate app & gossipsub score by @leviathanbeak
in #1028
* Adding sentry data synchronization by @rfuelsh in
#1115
* Capture metrics for graphql api by @Voxelot in
#1113
* Update cargo audit and add to commit by @freesig in
#1152
* add task params by @leviathanbeak in
#1159
* Took into account that block creation could take some time by @xgreenx
in #1162
* Applying optimizations from `0.17.11` release by @xgreenx in
#1158


**Full Changelog**:
v0.17.3...v0.18.0
Dentosal added a commit to FuelLabs/fuel-core that referenced this pull request Apr 28, 2023
Fixes #1164. Prepares for wide math intstruction benchmarking.

Most importantly this addresses the SMO changes from
FuelLabs/fuel-vm#407 and
FuelLabs/fuel-vm#404, and ALOC/HP changes from
FuelLabs/fuel-vm#377

---------

Co-authored-by: Tom <tomrgowan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuel-vm Related to the `fuel-vm` crate.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reassess the nature of the heap and $hp.
4 participants