Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .changes/changed/2767.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated fuel-vm to v0.60.0, see [release notes](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.60.0).
106 changes: 66 additions & 40 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 @@ -103,7 +103,7 @@ fuel-core-global-merkle-root-storage = { version = "0.41.7", path = "./crates/pr
fuel-core-global-merkle-root-service = { version = "0.41.7", path = "./crates/proof_system/global_merkle_root/service" }

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

# Common dependencies
anyhow = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion benches/benches/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ where
black_box(vm.prepare_call(ra, rb, rc, rd)).unwrap();
}
_ => {
black_box(vm.instruction(*instruction).unwrap());
black_box(vm.instruction::<_, false>(*instruction).unwrap());
}
}
black_box(&vm);
Expand Down
4 changes: 2 additions & 2 deletions benches/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ impl TryFrom<VmBench> for VmBenchPrepared {
vm.prepare_call(ra, rb, rc, rd)
.map_err(anyhow::Error::msg)?;
for instruction in post_call {
vm.instruction(instruction).unwrap();
vm.instruction::<_, false>(instruction).unwrap();
}
}

Expand All @@ -548,7 +548,7 @@ impl TryFrom<VmBench> for VmBenchPrepared {
vm.prepare_call(ra, rb, rc, rd).unwrap();
}
_ => {
vm.instruction(instruction).unwrap();
vm.instruction::<_, false>(instruction).unwrap();
}
}
let storage_diff = vm.storage_diff();
Expand Down
9 changes: 4 additions & 5 deletions crates/fuel-core/src/database/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,21 @@ where
for<'a> StorageTransaction<&'a Storage>: StorageWrite<M, Error = StorageError>,
Self: Modifiable,
{
fn write_bytes(&mut self, key: &M::Key, buf: &[u8]) -> Result<usize, Self::Error> {
fn write_bytes(&mut self, key: &M::Key, buf: &[u8]) -> Result<(), Self::Error> {
let mut transaction = StorageTransaction::transaction(
self.as_ref(),
ConflictPolicy::Overwrite,
Default::default(),
);
let prev = <_ as StorageWrite<M>>::write_bytes(&mut transaction, key, buf)?;
self.commit_changes(transaction.into_changes())?;
Ok(prev)
<_ as StorageWrite<M>>::write_bytes(&mut transaction, key, buf)?;
self.commit_changes(transaction.into_changes())
}

fn replace_bytes(
&mut self,
key: &M::Key,
buf: &[u8],
) -> Result<(usize, Option<Vec<u8>>), Self::Error> {
) -> Result<Option<Vec<u8>>, Self::Error> {
let mut transaction = StorageTransaction::transaction(
self.as_ref(),
ConflictPolicy::Overwrite,
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/graphql_api/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ impl StorageRead<BlobData> for ReadView {
key: &BlobId,
offset: usize,
buf: &mut [u8],
) -> Result<Option<usize>, Self::Error> {
) -> Result<bool, Self::Error> {
StorageRead::<BlobData>::read(self.on_chain.as_ref(), key, offset, buf)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/schema/dap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl ConcreteStorage {
pub fn exec(&mut self, id: &ID, op: Instruction) -> anyhow::Result<()> {
self.vm
.get_mut(id)
.map(|vm| vm.instruction(op))
.map(|vm| vm.instruction::<_, false>(op))
.transpose()
.map_err(|e| anyhow::anyhow!(e))?
.map(|_| ())
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/state/data_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
column: Self::Column,
offset: usize,
buf: &mut [u8],
) -> StorageResult<Option<usize>> {
) -> StorageResult<bool> {
self.data.read(key, column, offset, buf)
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/fuel-core/src/state/generic_database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ where
key: &M::Key,
offset: usize,
buf: &mut [u8],
) -> Result<Option<usize>, Self::Error> {
) -> Result<bool, Self::Error> {
self.storage.storage::<M>().read(key, offset, buf)
}

Expand Down Expand Up @@ -141,7 +141,7 @@ where
column: Self::Column,
offset: usize,
buf: &mut [u8],
) -> StorageResult<Option<usize>> {
) -> StorageResult<bool> {
KeyValueInspect::read(&self.storage, key, column, offset, buf)
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/state/historical_rocksdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ where
column: Self::Column,
offset: usize,
buf: &mut [u8],
) -> StorageResult<Option<usize>> {
) -> StorageResult<bool> {
self.db
.read(key, Column::OriginalColumn(column), offset, buf)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/state/iterable_key_value_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
column: Self::Column,
offset: usize,
buf: &mut [u8],
) -> StorageResult<Option<usize>> {
) -> StorageResult<bool> {
self.0.read(key, column, offset, buf)
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/fuel-core/src/state/key_value_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ where
column: Self::Column,
offset: usize,
buf: &mut [u8],
) -> StorageResult<Option<usize>> {
) -> StorageResult<bool> {
self.0.read(key, column, offset, buf)
}
}
Loading
Loading