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

chore: bump fuels-rs to 0.66.0 #6409

Closed
wants to merge 7 commits into from
Closed
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
728 changes: 274 additions & 454 deletions Cargo.lock

Large diffs are not rendered by default.

21 changes: 10 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ exclude = [

[workspace.dependencies]
# Dependencies from the `fuel-core` repository:
fuel-core-client = { version = "0.28.0", default-features = false }
fuel-core-types = { version = "0.28.0", default-features = false }
fuel-core-client = { version = "0.32.0", default-features = false }
fuel-core-types = { version = "0.32.0", default-features = false }

# Dependencies from the `fuel-vm` repository:
fuel-asm = "0.52.0"
fuel-crypto = "0.52.0"
fuel-types = "0.52.0"
fuel-tx = "0.52.0"
fuel-vm = "0.52.0"
fuel-asm = "0.56.0"
fuel-crypto = "0.56.0"
fuel-types = "0.56.0"
fuel-tx = "0.56.0"
fuel-vm = "0.56.0"

# Dependencies from the `fuels-rs` repository:
fuels-core = "0.64.0"
fuels-accounts = "0.64.0"
fuels-core = "0.66.0"
fuels-accounts = "0.66.0"

# Dependencies from the `forc-wallet` repository:
forc-wallet = "0.8.1"
forc-wallet = "0.9.0"

# Dependencies from the `fuel-abi-types` repository:
fuel-abi-types = "0.5.0"
Expand All @@ -60,4 +60,3 @@ authors = ["Fuel Labs <contact@fuel.sh>"]
homepage = "https://fuel.network/"
license = "Apache-2.0"
repository = "https://github.com/FuelLabs/sway"

4 changes: 3 additions & 1 deletion sway-ast/src/expr/op_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ define_op_codes!(
),
(Croo, CrooOpcode, "croo", (addr: reg, contract: reg)),
(Csiz, CsizOpcode, "csiz", (ret: reg, contract: reg)),
(Ldc, LdcOpcode, "ldc", (contract: reg, addr: reg, size: reg)),
(Bsiz, BsizOpcode, "bsiz", (ret: reg, contract: reg)),
(Ldc, LdcOpcode, "ldc", (contract: reg, addr: reg, size: reg, mode: imm)),
(Bldd, BlddOpcode, "bldd", (dst_ptr: reg, addr: reg, offset: reg, len: reg)),
(
Log,
LogOpcode,
Expand Down
2 changes: 2 additions & 0 deletions sway-core/src/asm_generation/finalized_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ fn print_instruction(op: &Instruction) {
Instruction::WDMM(x) => f("WDMM", x.unpack()),
Instruction::WQMM(x) => f("WQMM", x.unpack()),
Instruction::ECAL(x) => f("ECAL", x.unpack()),
Instruction::BSIZ(x) => f("BSIZ", x.unpack()),
Instruction::BLDD(x) => f("BLDD", x.unpack()),
}
}

Expand Down
45 changes: 37 additions & 8 deletions sway-core/src/asm_lang/allocated_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,19 @@ pub(crate) enum AllocatedOpcode {
),
CROO(AllocatedRegister, AllocatedRegister),
CSIZ(AllocatedRegister, AllocatedRegister),
LDC(AllocatedRegister, AllocatedRegister, AllocatedRegister),
BSIZ(AllocatedRegister, AllocatedRegister),
LDC(
AllocatedRegister,
AllocatedRegister,
AllocatedRegister,
VirtualImmediate06,
),
BLDD(
AllocatedRegister,
AllocatedRegister,
AllocatedRegister,
AllocatedRegister,
),
LOG(
AllocatedRegister,
AllocatedRegister,
Expand Down Expand Up @@ -229,7 +241,12 @@ pub(crate) enum AllocatedOpcode {
/* Cryptographic Instructions */
ECK1(AllocatedRegister, AllocatedRegister, AllocatedRegister),
ECR1(AllocatedRegister, AllocatedRegister, AllocatedRegister),
ED19(AllocatedRegister, AllocatedRegister, AllocatedRegister),
ED19(
AllocatedRegister,
AllocatedRegister,
AllocatedRegister,
AllocatedRegister,
),
K256(AllocatedRegister, AllocatedRegister, AllocatedRegister),
S256(AllocatedRegister, AllocatedRegister, AllocatedRegister),

Expand Down Expand Up @@ -330,7 +347,9 @@ impl AllocatedOpcode {
CCP(_r1, _r2, _r3, _r4) => vec![],
CROO(_r1, _r2) => vec![],
CSIZ(r1, _r2) => vec![r1],
LDC(_r1, _r2, _r3) => vec![],
BSIZ(r1, _r2) => vec![r1],
LDC(_r1, _r2, _r3, _i0) => vec![],
BLDD(_r1, _r2, _r3, _r4) => vec![],
LOG(_r1, _r2, _r3, _r4) => vec![],
LOGD(_r1, _r2, _r3, _r4) => vec![],
MINT(_r1, _r2) => vec![],
Expand All @@ -349,7 +368,7 @@ impl AllocatedOpcode {
/* Cryptographic Instructions */
ECK1(_r1, _r2, _r3) => vec![],
ECR1(_r1, _r2, _r3) => vec![],
ED19(_r1, _r2, _r3) => vec![],
ED19(_r1, _r2, _r3, _r4) => vec![],
K256(_r1, _r2, _r3) => vec![],
S256(_r1, _r2, _r3) => vec![],

Expand Down Expand Up @@ -454,7 +473,9 @@ impl fmt::Display for AllocatedOpcode {
CCP(a, b, c, d) => write!(fmtr, "ccp {a} {b} {c} {d}"),
CROO(a, b) => write!(fmtr, "croo {a} {b}"),
CSIZ(a, b) => write!(fmtr, "csiz {a} {b}"),
LDC(a, b, c) => write!(fmtr, "ldc {a} {b} {c}"),
BSIZ(a, b) => write!(fmtr, "bsiz {a} {b}"),
LDC(a, b, c, d) => write!(fmtr, "ldc {a} {b} {c} {d}"),
BLDD(a, b, c, d) => write!(fmtr, "bldd {a} {b} {c} {d}"),
LOG(a, b, c, d) => write!(fmtr, "log {a} {b} {c} {d}"),
LOGD(a, b, c, d) => write!(fmtr, "logd {a} {b} {c} {d}"),
MINT(a, b) => write!(fmtr, "mint {a} {b}"),
Expand All @@ -473,7 +494,7 @@ impl fmt::Display for AllocatedOpcode {
/* Cryptographic Instructions */
ECK1(a, b, c) => write!(fmtr, "eck1 {a} {b} {c}"),
ECR1(a, b, c) => write!(fmtr, "ecr1 {a} {b} {c}"),
ED19(a, b, c) => write!(fmtr, "ed19 {a} {b} {c}"),
ED19(a, b, c, d) => write!(fmtr, "ed19 {a} {b} {c} {d}"),
K256(a, b, c) => write!(fmtr, "k256 {a} {b} {c}"),
S256(a, b, c) => write!(fmtr, "s256 {a} {b} {c}"),

Expand Down Expand Up @@ -630,7 +651,13 @@ impl AllocatedOp {
}
CROO(a, b) => op::CROO::new(a.to_reg_id(), b.to_reg_id()).into(),
CSIZ(a, b) => op::CSIZ::new(a.to_reg_id(), b.to_reg_id()).into(),
LDC(a, b, c) => op::LDC::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id()).into(),
BSIZ(a, b) => op::BSIZ::new(a.to_reg_id(), b.to_reg_id()).into(),
LDC(a, b, c, d) => {
op::LDC::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id(), d.value.into()).into()
}
BLDD(a, b, c, d) => {
op::BLDD::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id(), d.to_reg_id()).into()
}
LOG(a, b, c, d) => {
op::LOG::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id(), d.to_reg_id()).into()
}
Expand Down Expand Up @@ -661,7 +688,9 @@ impl AllocatedOp {
/* Cryptographic Instructions */
ECK1(a, b, c) => op::ECK1::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id()).into(),
ECR1(a, b, c) => op::ECR1::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id()).into(),
ED19(a, b, c) => op::ED19::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id()).into(),
ED19(a, b, c, d) => {
op::ED19::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id(), d.to_reg_id()).into()
}
K256(a, b, c) => op::K256::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id()).into(),
S256(a, b, c) => op::S256::new(a.to_reg_id(), b.to_reg_id(), c.to_reg_id()).into(),

Expand Down
78 changes: 71 additions & 7 deletions sway-core/src/asm_lang/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,13 @@ impl Op {
let (r1, r2) = two_regs(handler, args, immediate, whole_op_span)?;
VirtualOp::CSIZ(r1, r2)
}

"bsiz" => {
let (r1, r2) = two_regs(handler, args, immediate, whole_op_span)?;
VirtualOp::BSIZ(r1, r2)
}
"ldc" => {
let (r1, r2, r3) = three_regs(handler, args, immediate, whole_op_span)?;
VirtualOp::LDC(r1, r2, r3)
let (r1, r2, r3, i0) = three_regs_imm_06(handler, args, immediate, whole_op_span)?;
VirtualOp::LDC(r1, r2, r3, i0)
}
"log" => {
let (r1, r2, r3, r4) = four_regs(handler, args, immediate, whole_op_span)?;
Expand Down Expand Up @@ -557,8 +560,8 @@ impl Op {
VirtualOp::ECR1(r1, r2, r3)
}
"ed19" => {
let (r1, r2, r3) = three_regs(handler, args, immediate, whole_op_span)?;
VirtualOp::ED19(r1, r2, r3)
let (r1, r2, r3, r4) = four_regs(handler, args, immediate, whole_op_span)?;
VirtualOp::ED19(r1, r2, r3, r4)
}
"k256" => {
let (r1, r2, r3) = three_regs(handler, args, immediate, whole_op_span)?;
Expand Down Expand Up @@ -981,6 +984,65 @@ fn two_regs_imm_12(
Ok((reg.clone(), reg2.clone(), imm))
}

fn three_regs_imm_06(
handler: &Handler,
args: &[VirtualRegister],
immediate: &Option<Ident>,
whole_op_span: Span,
) -> Result<
(
VirtualRegister,
VirtualRegister,
VirtualRegister,
VirtualImmediate06,
),
ErrorEmitted,
> {
if args.len() > 3 {
handler.emit_err(CompileError::IncorrectNumberOfAsmRegisters {
span: whole_op_span.clone(),
expected: 3,
received: args.len(),
});
}
let (reg, reg2, reg3) = match (args.first(), args.get(1), args.get(2)) {
(Some(reg), Some(reg2), Some(reg3)) => (reg, reg2, reg3),
_ => {
return Err(
handler.emit_err(CompileError::IncorrectNumberOfAsmRegisters {
span: whole_op_span,
expected: 3,
received: args.len(),
}),
);
}
};
let (imm, imm_span): (u64, _) = match immediate {
None => {
return Err(handler.emit_err(CompileError::MissingImmediate {
span: whole_op_span,
}));
}
Some(i) => match i.as_str()[1..].parse() {
Ok(o) => (o, i.span()),
Err(_) => {
return Err(
handler.emit_err(CompileError::InvalidImmediateValue { span: i.span() })
);
}
},
};

let imm = match VirtualImmediate06::new(imm, imm_span) {
Ok(o) => o,
Err(e) => {
return Err(handler.emit_err(e));
}
};

Ok((reg.clone(), reg2.clone(), reg3.clone(), imm))
}

impl fmt::Display for Op {
fn fmt(&self, fmtr: &mut fmt::Formatter<'_>) -> fmt::Result {
// We want the comment to always be 40 characters offset to the right to not interfere with
Expand Down Expand Up @@ -1073,7 +1135,9 @@ impl fmt::Display for VirtualOp {
CCP(a, b, c, d) => write!(fmtr, "ccp {a} {b} {c} {d}"),
CROO(a, b) => write!(fmtr, "croo {a} {b}"),
CSIZ(a, b) => write!(fmtr, "csiz {a} {b}"),
LDC(a, b, c) => write!(fmtr, "ldc {a} {b} {c}"),
BSIZ(a, b) => write!(fmtr, "bsiz {a} {b}"),
LDC(a, b, c, d) => write!(fmtr, "ldc {a} {b} {c} {d}"),
BLDD(a, b, c, d) => write!(fmtr, "bldd {a} {b} {c} {d}"),
LOG(a, b, c, d) => write!(fmtr, "log {a} {b} {c} {d}"),
LOGD(a, b, c, d) => write!(fmtr, "logd {a} {b} {c} {d}"),
MINT(a, b) => write!(fmtr, "mint {a} {b}"),
Expand All @@ -1092,7 +1156,7 @@ impl fmt::Display for VirtualOp {
/* Cryptographic Instructions */
ECK1(a, b, c) => write!(fmtr, "eck1 {a} {b} {c}"),
ECR1(a, b, c) => write!(fmtr, "ecr1 {a} {b} {c}"),
ED19(a, b, c) => write!(fmtr, "ed19 {a} {b} {c}"),
ED19(a, b, c, d) => write!(fmtr, "ed19 {a} {b} {c} {d}"),
K256(a, b, c) => write!(fmtr, "k256 {a} {b} {c}"),
S256(a, b, c) => write!(fmtr, "s256 {a} {b} {c}"),

Expand Down
Loading