Skip to content

Commit e43b945

Browse files
committed
Update to fuel-vm 0.60.0 (#2767)
Bumps fuel-vm to latest version. Currently waiting for new version release: FuelLabs/fuel-vm#921 ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [x] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [x] I have created follow-up issues caused by this PR and linked them here
1 parent 6867df6 commit e43b945

File tree

19 files changed

+152
-131
lines changed

19 files changed

+152
-131
lines changed

.changes/changed/2767.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated fuel-vm to v0.60.0, see [release notes](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.60.0).

Cargo.lock

Lines changed: 66 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fuel-core-global-merkle-root-storage = { version = "0.41.7", path = "./crates/pr
103103
fuel-core-global-merkle-root-service = { version = "0.41.7", path = "./crates/proof_system/global_merkle_root/service" }
104104

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

108108
# Common dependencies
109109
anyhow = "1.0"

benches/benches/vm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ where
5959
black_box(vm.prepare_call(ra, rb, rc, rd)).unwrap();
6060
}
6161
_ => {
62-
black_box(vm.instruction(*instruction).unwrap());
62+
black_box(vm.instruction::<_, false>(*instruction).unwrap());
6363
}
6464
}
6565
black_box(&vm);

benches/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl TryFrom<VmBench> for VmBenchPrepared {
536536
vm.prepare_call(ra, rb, rc, rd)
537537
.map_err(anyhow::Error::msg)?;
538538
for instruction in post_call {
539-
vm.instruction(instruction).unwrap();
539+
vm.instruction::<_, false>(instruction).unwrap();
540540
}
541541
}
542542

@@ -548,7 +548,7 @@ impl TryFrom<VmBench> for VmBenchPrepared {
548548
vm.prepare_call(ra, rb, rc, rd).unwrap();
549549
}
550550
_ => {
551-
vm.instruction(instruction).unwrap();
551+
vm.instruction::<_, false>(instruction).unwrap();
552552
}
553553
}
554554
let storage_diff = vm.storage_diff();

crates/fuel-core/src/database/storage.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,21 @@ where
5757
for<'a> StorageTransaction<&'a Storage>: StorageWrite<M, Error = StorageError>,
5858
Self: Modifiable,
5959
{
60-
fn write_bytes(&mut self, key: &M::Key, buf: &[u8]) -> Result<usize, Self::Error> {
60+
fn write_bytes(&mut self, key: &M::Key, buf: &[u8]) -> Result<(), Self::Error> {
6161
let mut transaction = StorageTransaction::transaction(
6262
self.as_ref(),
6363
ConflictPolicy::Overwrite,
6464
Default::default(),
6565
);
66-
let prev = <_ as StorageWrite<M>>::write_bytes(&mut transaction, key, buf)?;
67-
self.commit_changes(transaction.into_changes())?;
68-
Ok(prev)
66+
<_ as StorageWrite<M>>::write_bytes(&mut transaction, key, buf)?;
67+
self.commit_changes(transaction.into_changes())
6968
}
7069

7170
fn replace_bytes(
7271
&mut self,
7372
key: &M::Key,
7473
buf: &[u8],
75-
) -> Result<(usize, Option<Vec<u8>>), Self::Error> {
74+
) -> Result<Option<Vec<u8>>, Self::Error> {
7675
let mut transaction = StorageTransaction::transaction(
7776
self.as_ref(),
7877
ConflictPolicy::Overwrite,

crates/fuel-core/src/graphql_api/database.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl StorageRead<BlobData> for ReadView {
311311
key: &BlobId,
312312
offset: usize,
313313
buf: &mut [u8],
314-
) -> Result<Option<usize>, Self::Error> {
314+
) -> Result<bool, Self::Error> {
315315
StorageRead::<BlobData>::read(self.on_chain.as_ref(), key, offset, buf)
316316
}
317317

crates/fuel-core/src/schema/dap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl ConcreteStorage {
207207
pub fn exec(&mut self, id: &ID, op: Instruction) -> anyhow::Result<()> {
208208
self.vm
209209
.get_mut(id)
210-
.map(|vm| vm.instruction(op))
210+
.map(|vm| vm.instruction::<_, false>(op))
211211
.transpose()
212212
.map_err(|e| anyhow::anyhow!(e))?
213213
.map(|_| ())

crates/fuel-core/src/state/data_source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ where
6969
column: Self::Column,
7070
offset: usize,
7171
buf: &mut [u8],
72-
) -> StorageResult<Option<usize>> {
72+
) -> StorageResult<bool> {
7373
self.data.read(key, column, offset, buf)
7474
}
7575
}

crates/fuel-core/src/state/generic_database.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ where
9393
key: &M::Key,
9494
offset: usize,
9595
buf: &mut [u8],
96-
) -> Result<Option<usize>, Self::Error> {
96+
) -> Result<bool, Self::Error> {
9797
self.storage.storage::<M>().read(key, offset, buf)
9898
}
9999

@@ -141,7 +141,7 @@ where
141141
column: Self::Column,
142142
offset: usize,
143143
buf: &mut [u8],
144-
) -> StorageResult<Option<usize>> {
144+
) -> StorageResult<bool> {
145145
KeyValueInspect::read(&self.storage, key, column, offset, buf)
146146
}
147147
}

0 commit comments

Comments
 (0)