-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Use DependentCost
for aloc
opcode
#1934
Conversation
# Conflicts: # CHANGELOG.md # Cargo.lock
…o/reuse-vm-memory
# Conflicts: # Cargo.lock # benches/benches/vm_initialization.rs
@@ -324,10 +324,9 @@ impl TryFrom<GasCosts> for fuel_core_types::fuel_tx::GasCosts { | |||
fn try_from(value: GasCosts) -> Result<Self, Self::Error> { | |||
match value.version { | |||
GasCostsVersion::V1 => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is GasCostsVersion still V1 but GasCostsValues is now V2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GraphQL version doesn't need to match the Rust version of the type. It was done to maintain backward compatibility. Because SDKs will throw an error if the version is unknown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it get confusing if the versions start diverging a lot over time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When it will diverging a lot, we just can jump straight to the highest=) I was done for backward compatibility until SDKs will handle it gracefully.
@@ -82,7 +82,6 @@ query { | |||
version | |||
add | |||
addi | |||
aloc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this break older SDK versions loading the gas costs for predicate estimation?
@@ -338,7 +338,7 @@ impl GasCosts { | |||
} | |||
|
|||
async fn aloc(&self) -> U64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disregard my earlier comment, it looks like this will retain backwards compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the only problem is that if Rust SDK is old and connected to fuel-core 0.27.0
, the predicate estimation can be incorrect if it uses an alco
opcode. But it should be addressed on Rust SDK side: FuelLabs/fuels-rs#1409
#[allow(clippy::unit_arg)] | ||
black_box( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this black_box
actually do anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -81,7 +81,7 @@ fuel-core-wasm-executor = { version = "0.27.0", path = "./crates/services/upgrad | |||
fuel-core-xtask = { version = "0.0.0", path = "./xtask" } | |||
|
|||
# Fuel dependencies | |||
fuel-vm-private = { version = "0.51.0", package = "fuel-vm", default-features = false } | |||
fuel-vm-private = { version = "0.52.0", package = "fuel-vm", default-features = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog says your updating to 0.51.0
, not 0.52.0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[#1888](https://github.com/FuelLabs/fuel-core/pull/1888): Upgraded `fuel-vm` to `0.51.0`. See [release](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.51.0) for more information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog related for 0.51.0
is from another PR, I just grouped everything together=)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we are being inconsistent about when we note these things, but I don't know that it matters
@@ -324,10 +324,9 @@ impl TryFrom<GasCosts> for fuel_core_types::fuel_tx::GasCosts { | |||
fn try_from(value: GasCosts) -> Result<Self, Self::Error> { | |||
match value.version { | |||
GasCostsVersion::V1 => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it get confusing if the versions start diverging a lot over time?
@@ -81,7 +81,7 @@ fuel-core-wasm-executor = { version = "0.27.0", path = "./crates/services/upgrad | |||
fuel-core-xtask = { version = "0.0.0", path = "./xtask" } | |||
|
|||
# Fuel dependencies | |||
fuel-vm-private = { version = "0.51.0", package = "fuel-vm", default-features = false } | |||
fuel-vm-private = { version = "0.52.0", package = "fuel-vm", default-features = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we are being inconsistent about when we note these things, but I don't know that it matters
## Version v0.28.0 ### Changed - [#1934](#1934): Updated benchmark for the `aloc` opcode to be `DependentCost`. Updated `vm_initialization` benchmark to exclude growing of memory(It is handled by VM reuse). - [#1916](#1916): Speed up synchronisation of the blocks for the `fuel-core-sync` service. - [#1888](#1888): optimization: Reuse VM memory across executions. #### Breaking - [#1934](#1934): Changed `GasCosts` endpoint to return `DependentCost` for the `aloc` opcode via `alocDependentCost`. - [#1934](#1934): Updated default gas costs for the local testnet configuration. All opcodes became cheaper. - [#1924](#1924): `dry_run_opt` has new `gas_price: Option<u64>` argument - [#1888](#1888): Upgraded `fuel-vm` to `0.51.0`. See [release](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.51.0) for more information. ### Added - [#1939](#1939): Added API functions to open a RocksDB in different modes. - [#1929](#1929): Added support of customization of the state transition version in the `ChainConfig`. ### Removed - [#1913](#1913): Removed dead code from the project. ### Fixed - [#1921](#1921): Fixed unstable `gossipsub_broadcast_tx_with_accept` test. - [#1915](#1915): Fixed reconnection issue in the dev cluster with AWS cluster. - [#1914](#1914): Fixed halting of the node during synchronization in PoA service. ## What's Changed * Removed dead code by @xgreenx in #1913 * Added backward and forward compatibility integration tests for forkless upgrades by @xgreenx in #1895 * Fixed halting of the node in rare conditions by @xgreenx in #1914 * Weekly `cargo update` by @github-actions in #1928 * Fixed logging of the WASM executor by @xgreenx in #1930 * Added support of customization of the state transition version in the `ChainConfig` by @xgreenx in #1929 * Document wasm toolchain installation, add rust-toolchain.toml by @Dentosal in #1932 * Add optional `gas_price` argument to `dry_run_opt` by @hal3e in #1924 * Reuse VM memory across executions by @Dentosal in #1888 * Fixed reconnection issue in the dev cluster with AWS cluster by @xgreenx in #1915 * Speeds up synchronisation of the blocks for the `fuel-core-sync` service by @xgreenx in #1916 * Fixed unstable `gossipsub_broadcast_tx_with_accept` test by @xgreenx in #1921 * Added API functions to open a RocksDB in different modes by @xgreenx in #1939 * Use `DependentCost` for `aloc` opcode by @xgreenx in #1934 ## New Contributors * @hal3e made their first contribution in #1924 **Full Changelog**: v0.27.0...v0.28.0
## Version v0.28.0 ### Changed - [#1934](FuelLabs/fuel-core#1934): Updated benchmark for the `aloc` opcode to be `DependentCost`. Updated `vm_initialization` benchmark to exclude growing of memory(It is handled by VM reuse). - [#1916](FuelLabs/fuel-core#1916): Speed up synchronisation of the blocks for the `fuel-core-sync` service. - [#1888](FuelLabs/fuel-core#1888): optimization: Reuse VM memory across executions. #### Breaking - [#1934](FuelLabs/fuel-core#1934): Changed `GasCosts` endpoint to return `DependentCost` for the `aloc` opcode via `alocDependentCost`. - [#1934](FuelLabs/fuel-core#1934): Updated default gas costs for the local testnet configuration. All opcodes became cheaper. - [#1924](FuelLabs/fuel-core#1924): `dry_run_opt` has new `gas_price: Option<u64>` argument - [#1888](FuelLabs/fuel-core#1888): Upgraded `fuel-vm` to `0.51.0`. See [release](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.51.0) for more information. ### Added - [#1939](FuelLabs/fuel-core#1939): Added API functions to open a RocksDB in different modes. - [#1929](FuelLabs/fuel-core#1929): Added support of customization of the state transition version in the `ChainConfig`. ### Removed - [#1913](FuelLabs/fuel-core#1913): Removed dead code from the project. ### Fixed - [#1921](FuelLabs/fuel-core#1921): Fixed unstable `gossipsub_broadcast_tx_with_accept` test. - [#1915](FuelLabs/fuel-core#1915): Fixed reconnection issue in the dev cluster with AWS cluster. - [#1914](FuelLabs/fuel-core#1914): Fixed halting of the node during synchronization in PoA service. ## What's Changed * Removed dead code by @xgreenx in FuelLabs/fuel-core#1913 * Added backward and forward compatibility integration tests for forkless upgrades by @xgreenx in FuelLabs/fuel-core#1895 * Fixed halting of the node in rare conditions by @xgreenx in FuelLabs/fuel-core#1914 * Weekly `cargo update` by @github-actions in FuelLabs/fuel-core#1928 * Fixed logging of the WASM executor by @xgreenx in FuelLabs/fuel-core#1930 * Added support of customization of the state transition version in the `ChainConfig` by @xgreenx in FuelLabs/fuel-core#1929 * Document wasm toolchain installation, add rust-toolchain.toml by @Dentosal in FuelLabs/fuel-core#1932 * Add optional `gas_price` argument to `dry_run_opt` by @hal3e in FuelLabs/fuel-core#1924 * Reuse VM memory across executions by @Dentosal in FuelLabs/fuel-core#1888 * Fixed reconnection issue in the dev cluster with AWS cluster by @xgreenx in FuelLabs/fuel-core#1915 * Speeds up synchronisation of the blocks for the `fuel-core-sync` service by @xgreenx in FuelLabs/fuel-core#1916 * Fixed unstable `gossipsub_broadcast_tx_with_accept` test by @xgreenx in FuelLabs/fuel-core#1921 * Added API functions to open a RocksDB in different modes by @xgreenx in FuelLabs/fuel-core#1939 * Use `DependentCost` for `aloc` opcode by @xgreenx in FuelLabs/fuel-core#1934 ## New Contributors * @hal3e made their first contribution in FuelLabs/fuel-core#1924 **Full Changelog**: FuelLabs/fuel-core@v0.27.0...v0.28.0
PR upgrades the
fuel-vm
to0.52.0
. A new VM changesaloc
opcode to beDependentCost
. It requires updated benchmarks.The PR also updates default gas costs according to a new Vultr instance we use to do benchmarks. It works faster than the previous one, so all opcodes became cheaper.
The
vm_initialziation
became much cheaper and now has reasonable values. Thebloc
opcode became expensive and depended on a number of allocated bytes.Checklist
Before requesting review
After merging, notify other teams