Skip to content

Commit a61bfde

Browse files
mriiseshamb0
authored andcommitted
EVM: Fix Precompile Failure Modes & Implement Remaining Precompile Tests (filecoin-project#654)
* bn pair tests and errors * add ec_recover test, fix broken implementation * add modexp test, add more test cases for ec_recover * only check lower bound for ec_recover * Fix broken failure modes in precompiles - ec_recover - modexp - ec_add - ec_mul Change error enum to include field error types + conversions - forked bn to derive Eq on bn Errors Add helper for reading padded bytes from input. * rustfmt & clippy * Update precompiles.rs * use cow instead of custom container * remove fork of bn * remove bn for dep * allocate ahead of time when reading sets of * lazy_static secp256k1 lower bound * left pad ecrecover * hex literal and cargo lock * add padding test * space * dont panic on modexp len * few remaining nits * rustfmt * better read logic of bigints for modexp * add notes to reading bigint lengths & refactor read group for more clarity * rustfmt
1 parent 142089d commit a61bfde

File tree

4 files changed

+432
-244
lines changed

4 files changed

+432
-244
lines changed

Cargo.lock

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

actors/evm/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ fixed-hash = { version = "0.7.0", default-features = false }
3838
impl-serde = { version = "0.3.2", default-features = false }
3939
arrayvec = { version = "0.7.2", features = ["serde"] }
4040
hex = "0.4.3"
41+
hex-literal = "0.3.4"
4142
substrate-bn = { version = "0.6.0", default-features = false }
4243
near-blake2 = { version = "0.9.1", git = "https://github.com/filecoin-project/near-blake2.git" }
44+
lazy_static = "1.4.0"
4345

4446
[dev-dependencies]
4547
fil_actors_runtime = { path = "../../runtime", features = ["test_utils", "sector-default"] }
46-
hex-literal = "0.3.4"
4748
etk-asm = "^0.2.1"
4849

4950
[features]

0 commit comments

Comments
 (0)