Skip to content

Commit 6f54b02

Browse files
authored
Merge branch 'master' into 2128-manually-produces-blocks-in-test-and-simulates-a-call-the-timestamp-is-not-correct
2 parents a5d2d35 + 525c48f commit 6f54b02

File tree

11 files changed

+776
-623
lines changed

11 files changed

+776
-623
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313

1414
#### Breaking
1515
- [2206](https://github.com/FuelLabs/fuel-core/pull/2206): Use timestamp of last block when dry running transactions.
16+
- [2153](https://github.com/FuelLabs/fuel-core/pull/2153): Updated default gas costs for the local testnet configuration to match `fuel-core 0.35.0`.
1617

1718
## [Version 0.36.0]
1819

benches/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fuel-core = { path = "../crates/fuel-core", default-features = false, features =
2525
fuel-core-chain-config = { workspace = true }
2626
fuel-core-database = { path = "./../crates/database" }
2727
fuel-core-services = { path = "./../crates/services" }
28-
fuel-core-storage = { path = "./../crates/storage" }
28+
fuel-core-storage = { path = "./../crates/storage", features = ["smt"] }
2929
fuel-core-sync = { path = "./../crates/services/sync", features = [
3030
"benchmarking",
3131
] }

benches/benches/vm_set/blockchain.rs

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ pub fn run(c: &mut Criterion) {
367367
let mut ccp = c.benchmark_group("ccp");
368368

369369
for i in linear.clone() {
370-
let mut code = vec![op::noop(); i as usize].into_iter().collect::<Vec<_>>();
370+
let mut code = vec![0; i as usize];
371371

372372
rng.fill_bytes(&mut code);
373373

@@ -391,10 +391,7 @@ pub fn run(c: &mut Criterion) {
391391
op::movi(0x12, 100_000),
392392
op::movi(0x13, i.try_into().unwrap()),
393393
op::cfe(0x13),
394-
op::movi(0x14, i.try_into().unwrap()),
395394
op::movi(0x15, i.try_into().unwrap()),
396-
op::add(0x15, 0x15, 0x15),
397-
op::addi(0x15, 0x15, 32),
398395
op::aloc(0x15),
399396
op::move_(0x15, RegId::HP),
400397
];
@@ -413,6 +410,51 @@ pub fn run(c: &mut Criterion) {
413410

414411
ccp.finish();
415412

413+
let mut bldd = c.benchmark_group("bldd");
414+
415+
for i in linear.clone() {
416+
let mut code = vec![0; i as usize];
417+
418+
rng.fill_bytes(&mut code);
419+
420+
let blob = BlobCode::from(code);
421+
422+
let data = blob
423+
.id
424+
.iter()
425+
.copied()
426+
.chain((0 as Word).to_be_bytes().iter().copied())
427+
.chain((0 as Word).to_be_bytes().iter().copied())
428+
.chain(AssetId::default().iter().copied())
429+
.collect();
430+
431+
let prepare_script = vec![
432+
op::gtf_args(0x10, 0x00, GTFArgs::ScriptData),
433+
op::addi(0x11, 0x10, BlobId::LEN.try_into().unwrap()),
434+
op::addi(0x11, 0x11, WORD_SIZE.try_into().unwrap()),
435+
op::addi(0x11, 0x11, WORD_SIZE.try_into().unwrap()),
436+
op::movi(0x12, 100_000),
437+
op::movi(0x13, i.try_into().unwrap()),
438+
op::cfe(0x13),
439+
op::movi(0x15, i.try_into().unwrap()),
440+
op::aloc(0x15),
441+
op::move_(0x15, RegId::HP),
442+
];
443+
444+
bldd.throughput(Throughput::Bytes(i));
445+
446+
run_group_ref(
447+
&mut bldd,
448+
format!("{i}"),
449+
VmBench::new(op::bldd(0x15, 0x10, RegId::ZERO, 0x13))
450+
.with_blob(blob)
451+
.with_data(data)
452+
.with_prepare_script(prepare_script),
453+
);
454+
}
455+
456+
bldd.finish();
457+
416458
let mut csiz = c.benchmark_group("csiz");
417459

418460
for i in linear.clone() {
@@ -441,6 +483,33 @@ pub fn run(c: &mut Criterion) {
441483

442484
csiz.finish();
443485

486+
let mut bsiz = c.benchmark_group("bsiz");
487+
488+
for i in linear.clone() {
489+
let mut code = vec![0u8; i as usize];
490+
491+
rng.fill_bytes(&mut code);
492+
493+
let blob = BlobCode::from(code);
494+
495+
let data = blob.id.iter().copied().collect();
496+
497+
let prepare_script = vec![op::gtf_args(0x10, 0x00, GTFArgs::ScriptData)];
498+
499+
bsiz.throughput(Throughput::Bytes(i));
500+
501+
run_group_ref(
502+
&mut bsiz,
503+
format!("{i}"),
504+
VmBench::new(op::bsiz(0x11, 0x10))
505+
.with_blob(blob)
506+
.with_data(data)
507+
.with_prepare_script(prepare_script),
508+
);
509+
}
510+
511+
bsiz.finish();
512+
444513
run_group_ref(
445514
&mut c.benchmark_group("bhei"),
446515
"bhei",

benches/benches/vm_set/mem.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ use criterion::{
1111
Throughput,
1212
};
1313
use fuel_core_benches::*;
14-
use fuel_core_types::fuel_asm::*;
14+
use fuel_core_types::{
15+
fuel_asm::*,
16+
fuel_vm::{
17+
consts::MEM_SIZE,
18+
interpreter::MemoryInstance,
19+
},
20+
};
1521

1622
pub fn run(c: &mut Criterion) {
1723
run_group_ref(
@@ -60,8 +66,11 @@ pub fn run(c: &mut Criterion) {
6066
cfe_linear.push(30_000_000);
6167
cfe_linear.push(60_000_000);
6268
for i in cfe_linear {
63-
let bench =
64-
VmBench::new(op::cfe(0x10)).with_prepare_script(set_full_word(0x10, i));
69+
let prepare_script = set_full_word(0x10, i);
70+
let memory = MemoryInstance::from(vec![123; MEM_SIZE]);
71+
let bench = VmBench::new(op::cfe(0x10))
72+
.with_prepare_script(prepare_script)
73+
.with_memory(memory);
6574
cfe.throughput(Throughput::Bytes(i));
6675
run_group_ref(&mut cfe, format!("{i}"), bench);
6776
}
@@ -77,7 +86,8 @@ pub fn run(c: &mut Criterion) {
7786
cfei_linear.push(1_000_000);
7887
cfei_linear.push(10_000_000);
7988
for i in cfei_linear {
80-
let bench = VmBench::new(op::cfei(i as u32));
89+
let memory = MemoryInstance::from(vec![123; MEM_SIZE]);
90+
let bench = VmBench::new(op::cfei(i as u32)).with_memory(memory);
8191
cfei.throughput(Throughput::Bytes(i));
8292
run_group_ref(&mut cfei, format!("{i}"), bench);
8393
}

benches/src/bin/collect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,12 @@ fn linear_regression(x_y: Vec<(u64, u64)>) -> f64 {
642642
}
643643

644644
fn dependent_cost(name: &String, x_y: Vec<(u64, u64)>) -> DependentCost {
645-
const NEAR_LINEAR: f64 = 0.1;
645+
const NEAR_LINEAR: f64 = 0.2;
646646

647647
#[derive(PartialEq, Eq)]
648648
enum Type {
649649
/// The points have a linear property. The first point
650-
/// and the last points are almost the same(The difference is < 0.1).
650+
/// and the last points are almost the same(The difference is < `NEAR_LINEAR`).
651651
Linear,
652652
/// When the delta of the last point is much lower than
653653
/// the first point, it is a logarithmic chart.

0 commit comments

Comments
 (0)