Skip to content

Commit

Permalink
Potential fix for softfork guard issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Nov 4, 2024
1 parent 2f413e7 commit fe356d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/chia_dialect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl Dialect for ChiaDialect {
) -> Response {
let flags = self.flags
| match extension {
OperatorSet::Unknown => 0,
OperatorSet::Default => 0,
OperatorSet::BLS => 0,
OperatorSet::Keccak => ENABLE_KECCAK_OPS_OUTSIDE_GUARD,
Expand Down Expand Up @@ -186,10 +187,11 @@ impl Dialect for ChiaDialect {
match ext {
// The BLS extensions (and coinid) operators were brought into the
// main operator set as part of the hard fork
0 => OperatorSet::BLS,
0 => OperatorSet::Default,
1 if (self.flags & ENABLE_KECCAK) != 0 => OperatorSet::Keccak,
1 => OperatorSet::BLS,
// new extensions go here
_ => OperatorSet::Default,
_ => OperatorSet::Unknown,
}
}

Expand Down
1 change: 1 addition & 0 deletions src/dialect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub enum OperatorSet {
Default,
BLS,
Keccak, // keccak256 operator
Unknown,
}

pub trait Dialect {
Expand Down
2 changes: 1 addition & 1 deletion src/run_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ impl<'a, D: Dialect> RunProgramContext<'a, D> {
let extension =
self.dialect
.softfork_extension(uint_atom::<4>(self.allocator, extension, "softfork")? as u32);
if extension == OperatorSet::Default {
if extension == OperatorSet::Unknown {
err(args, "unknown softfork extension")
} else {
Ok((extension, program, env))
Expand Down

0 comments on commit fe356d6

Please sign in to comment.