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

Refactor fuel-core to use version of StorageRead::read with offset (Full update to 0.59.1) #2438

Merged
merged 31 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
afbfef2
Refactor fuel-core to use version of StorageRead::read with offset
acerone85 Nov 14, 2024
2b6e689
Merge branch 'master' into use-storage-read-with-offset
acerone85 Nov 14, 2024
8c27f1f
Changelog
acerone85 Nov 14, 2024
ba070e2
Merge branch 'master' into use-storage-read-with-offset
acerone85 Dec 4, 2024
83d9641
Update fuel-vm to 0.59.0
acerone85 Dec 4, 2024
5ca045e
Add missing todo
acerone85 Dec 4, 2024
bfe28fe
Fix snapshot
acerone85 Dec 4, 2024
ba9f641
Add block height and fix gas version
AurelienFT Dec 4, 2024
71a2be2
Remove old todo
AurelienFT Dec 4, 2024
f538a65
Fix compil
AurelienFT Dec 4, 2024
759110b
Add value new policy
AurelienFT Dec 4, 2024
7f4bd85
Add safety checks
acerone85 Dec 4, 2024
5356264
Use master and fix derivative error.
AurelienFT Dec 9, 2024
c80881e
Fix lint toml
AurelienFT Dec 9, 2024
b1565f8
format prettier toml
AurelienFT Dec 9, 2024
59b4fc9
Lint toml.
AurelienFT Dec 9, 2024
0a27919
Merge branch 'master' into use-storage-read-with-offset
AurelienFT Dec 9, 2024
ef013b9
Merge branch 'master' into use-storage-read-with-offset
AurelienFT Dec 10, 2024
c668c15
Remove old serialization json version
AurelienFT Dec 10, 2024
e41ede9
fix tx json
AurelienFT Dec 10, 2024
7d60ea7
Update config files
AurelienFT Dec 11, 2024
15f404f
Update more config file with the new opcode
AurelienFT Dec 11, 2024
5b5ac86
Rust FMT
AurelienFT Dec 11, 2024
9d9deca
Fix nulleable gas costs.
AurelienFT Dec 11, 2024
e9ade9a
Update snapshot query graphql with new opcodes
AurelienFT Dec 11, 2024
d68995b
fix local chain config
AurelienFT Dec 11, 2024
e203ebb
use fuel-vm 0.59.1
AurelienFT Dec 13, 2024
5cd834a
Merge branch 'master' into use-storage-read-with-offset
AurelienFT Dec 13, 2024
2fc07bb
Merge branch 'master' into use-storage-read-with-offset
AurelienFT Dec 23, 2024
7fc47f1
Use `rollback_to` correctly.
xgreenx Dec 23, 2024
07d5ac3
Update CHANGELOG.md
xgreenx Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [2468](https://github.com/FuelLabs/fuel-core/pull/2468): Abstract unrecorded blocks concept for V1 algorithm, create new storage impl. Introduce `TransactionableStorage` trait to allow atomic changes to the storage.
- [2295](https://github.com/FuelLabs/fuel-core/pull/2295): `CombinedDb::from_config` now respects `state_rewind_policy` with tmp RocksDB.
- [2378](https://github.com/FuelLabs/fuel-core/pull/2378): Use cached hash of the topic instead of calculating it on each publishing gossip message.
- [2438](https://github.com/FuelLabs/fuel-core/pull/2438): Refactored service to use new implementation of `StorageRead::read` that takes an offset in input.
- [2429](https://github.com/FuelLabs/fuel-core/pull/2429): Introduce custom enum for representing result of running service tasks
- [2377](https://github.com/FuelLabs/fuel-core/pull/2377): Add more errors that can be returned as responses when using protocol `/fuel/req_res/0.0.2`. The errors supported are `ProtocolV1EmptyResponse` (status code `0`) for converting empty responses sent via protocol `/fuel/req_res/0.0.1`, `RequestedRangeTooLarge`(status code `1`) if the client requests a range of objects such as sealed block headers or transactions too large, `Timeout` (status code `2`) if the remote peer takes too long to fulfill a request, or `SyncProcessorOutOfCapacity` if the remote peer is fulfilling too many requests concurrently.
- [2233](https://github.com/FuelLabs/fuel-core/pull/2233): Introduce a new column `modification_history_v2` for storing the modification history in the historical rocksDB. Keys in this column are stored in big endian order. Changed the behaviour of the historical rocksDB to write changes for new block heights to the new column, and to perform lookup of values from the `modification_history_v2` table first, and then from the `modification_history` table, performing a migration upon access if necessary.

#### Breaking
- [2438](https://github.com/FuelLabs/fuel-core/pull/2438): The `fuel-core-client` can only work with new version of the `fuel-core`. The `0.40` and all older versions are not supported.
- [2438](https://github.com/FuelLabs/fuel-core/pull/2438): Updated `fuel-vm` to `0.59.1` release. Check [release notes](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.59.0) for more details.
- [2389](https://github.com/FuelLabs/fuel-core/pull/2258): Updated the `messageProof` GraphQL schema to return a non-nullable `MessageProof`.
- [2154](https://github.com/FuelLabs/fuel-core/pull/2154): Transaction graphql endpoints use `TransactionType` instead of `fuel_tx::Transaction`.
- [2446](https://github.com/FuelLabs/fuel-core/pull/2446): Use graphiql instead of graphql-playground due to known vulnerability and stale development.
Expand Down
128 changes: 89 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fuel-core-xtask = { version = "0.0.0", path = "./xtask" }
fuel-gas-price-algorithm = { version = "0.40.0", path = "crates/fuel-gas-price-algorithm" }

# Fuel dependencies
fuel-vm-private = { version = "0.58.2", package = "fuel-vm", default-features = false }
fuel-vm-private = { version = "0.59.1", package = "fuel-vm", default-features = false }

# Common dependencies
anyhow = "1.0"
Expand Down
3 changes: 0 additions & 3 deletions benches/benches/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ where
let clock = quanta::Clock::new();

let original_db = vm.as_mut().database_mut().clone();
let original_memory = vm.memory().clone();
// During block production/validation for each state, which may affect the state of the database,
// we create a new storage transaction. The code here simulates the same behavior to have
// the same nesting level and the same performance.
Expand All @@ -53,7 +52,6 @@ where

let mut total = core::time::Duration::ZERO;
for _ in 0..iters {
vm.memory_mut().clone_from(&original_memory);
let start = black_box(clock.raw());
match instruction {
Instruction::CALL(call) => {
Expand All @@ -72,7 +70,6 @@ where
vm.as_mut().database_mut().reset_changes();
}
*vm.as_mut().database_mut() = original_db;
*vm.memory_mut() = original_memory;
total
})
});
Expand Down
11 changes: 9 additions & 2 deletions benches/src/default_gas_costs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::*;
use fuel_core_types::fuel_tx::consensus_parameters::gas::GasCostsValuesV4;
use fuel_core_types::fuel_tx::consensus_parameters::gas::GasCostsValuesV5;
pub fn default_gas_costs() -> GasCostsValues {
GasCostsValuesV4 {
GasCostsValuesV5 {
add: 2,
addi: 2,
and: 2,
Expand Down Expand Up @@ -90,6 +90,13 @@ pub fn default_gas_costs() -> GasCostsValues {
wqmm: 6,
xor: 2,
xori: 2,
// TODO: Change to correct values
ecop: 2,
// TODO: Change to correct values
epar: DependentCost::HeavyOperation {
base: 2,
gas_per_unit: 2,
},
aloc: DependentCost::LightOperation {
base: 2,
units_per_gas: 35,
Expand Down
10 changes: 3 additions & 7 deletions benches/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,6 @@ impl TryFrom<VmBench> for VmBenchPrepared {
let prepare_script = prepare_script
.into_iter()
.chain(iter::once(op::ret(RegId::ONE)))
.chain(iter::once(instruction))
.collect();

let mut tx = TransactionBuilder::script(prepare_script, data);
Expand Down Expand Up @@ -531,9 +530,7 @@ impl TryFrom<VmBench> for VmBenchPrepared {
}
}

let start_vm = vm.clone();
let original_db = vm.as_mut().database_mut().clone();
let original_memory = vm.memory().clone();
let vm_before_first_instruction = vm.clone();
let mut vm = vm.add_recording();
match instruction {
Instruction::CALL(call) => {
Expand All @@ -546,12 +543,11 @@ impl TryFrom<VmBench> for VmBenchPrepared {
}
let storage_diff = vm.storage_diff();
let mut vm = vm.remove_recording();
let mut diff = start_vm.diff(&vm);
let mut diff = vm.rollback_to(&vm_before_first_instruction);
diff += storage_diff;
let diff: diff::Diff<diff::InitialVmState> = diff.into();
vm.reset_vm_state(&diff);
*vm.as_mut().database_mut() = original_db;
*vm.memory_mut() = original_memory;
assert_eq!(vm_before_first_instruction, vm);

Ok(Self {
vm,
Expand Down
Loading
Loading