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

Rust 1.79.0 #806

Merged
merged 3 commits into from
Aug 22, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:

env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.75.0
RUST_VERSION: 1.79.0
RUST_VERSION_FMT: nightly-2024-02-07
RUST_VERSION_COV: nightly-2024-06-05
GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- [#796](https://github.com/FuelLabs/fuel-vm/pull/796): Added implementation of the `MerkleRootStorage` for references.

### Changed
- [#806](https://github.com/FuelLabs/fuel-vm/pull/806): Update MSRV to 1.79.0.

#### Breaking
- [#780](https://github.com/FuelLabs/fuel-vm/pull/780): Added `Blob` transaction, and `BSIZ` and `BLDD` instructions. Also allows `LDC` to load blobs.
- [#795](https://github.com/FuelLabs/fuel-vm/pull/795): Fixed `ed19` instruction to take variable length message instead of a fixed-length one. Changed the gas cost to be `DependentCost`.
Expand Down
2 changes: 1 addition & 1 deletion ci_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# The script runs almost all CI checks locally.
#
# Requires installed:
# - Rust `1.75.0`
# - Rust `1.79.0`
# - Nightly rust formatter
# - `rustup target add thumbv6m-none-eabi`
# - `rustup target add wasm32-unknown-unknown`
Expand Down
1 change: 1 addition & 0 deletions fuel-asm/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ macro_rules! impl_instructions {
// Recursively generate a test constructor for each opcode
(impl_opcode_test_construct $doc:literal $ix:literal $Op:ident $op:ident [$($fname:ident: $field:ident)*] $($rest:tt)*) => {
#[cfg(test)]
#[allow(clippy::cast_possible_truncation)]
impl crate::_op::$Op {
op_test_construct_fn!($($field)*);
}
Expand Down
4 changes: 2 additions & 2 deletions fuel-tx/src/tests/offset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ where
outputs_assert(tx, bytes, cases);
}

fn inputs_assert<Tx: Inputs>(tx: &Tx, bytes: &[u8], cases: &mut TestedFields)
fn inputs_assert<Tx>(tx: &Tx, bytes: &[u8], cases: &mut TestedFields)
where
Tx: Buildable,
Tx: Inputs + Buildable,
{
tx.inputs().iter().enumerate().for_each(|(idx, i)| {
let input_ofs = tx
Expand Down
12 changes: 6 additions & 6 deletions fuel-tx/src/transaction/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ mod tests {
fn id() {
let rng = &mut StdRng::seed_from_u64(8586);

let inputs = vec![
let inputs = [
vec![],
vec![
Input::coin_signed(
Expand Down Expand Up @@ -672,7 +672,7 @@ mod tests {
],
];

let outputs = vec![
let outputs = [
vec![],
vec![
Output::coin(rng.gen(), rng.next_u64(), rng.gen()),
Expand All @@ -683,14 +683,14 @@ mod tests {
],
];

let witnesses = vec![
let witnesses = [
vec![],
vec![generate_bytes(rng).into(), generate_bytes(rng).into()],
];

let scripts = vec![vec![], generate_bytes(rng), generate_bytes(rng)];
let script_data = vec![vec![], generate_bytes(rng), generate_bytes(rng)];
let storage_slots = vec![vec![], vec![rng.gen(), rng.gen()]];
let scripts = [vec![], generate_bytes(rng), generate_bytes(rng)];
let script_data = [vec![], generate_bytes(rng), generate_bytes(rng)];
let storage_slots = [vec![], vec![rng.gen(), rng.gen()]];
let purposes = [
UpgradePurposeType::ConsensusParameters {
witness_index: rng.gen(),
Expand Down
13 changes: 6 additions & 7 deletions fuel-vm/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ macro_rules! script_with_data_offset {
fuel_types::bytes::padded_len,
prelude::Immediate18,
};
($tx_offset
let value: Immediate18 = $tx_offset
.saturating_add(Script::script_offset_static())
.saturating_add(
padded_len(script_bytes.as_slice()).unwrap_or(usize::MAX),
) as Immediate18)
)
.try_into()
.expect("script data offset is too large");
value
}
};
// re-evaluate and return the finalized script with the correct data offset length
Expand Down Expand Up @@ -433,11 +436,7 @@ pub mod test_helpers {
initial_balance: Option<(AssetId, Word)>,
initial_state: Option<Vec<StorageSlot>>,
) -> CreatedContract {
let storage_slots = if let Some(slots) = initial_state {
slots
} else {
Default::default()
};
let storage_slots = initial_state.unwrap_or_default();

let salt: Salt = self.rng.gen();
let program: Witness = contract
Expand Down
Loading