diff --git a/Cargo.lock b/Cargo.lock index 8bc84bfa6..51d22d5c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -104,17 +104,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "aurora-bn" -version = "0.1.0" -source = "git+https://github.com/aurora-is-near/aurora-bn.git#8f1743884061981cac84388862e2763b2aa09307" -dependencies = [ - "byteorder", - "getrandom 0.2.7", - "rand 0.8.5", - "serde", -] - [[package]] name = "aurora-engine" version = "2.6.1" @@ -141,7 +130,6 @@ dependencies = [ name = "aurora-engine-precompiles" version = "1.0.0" dependencies = [ - "aurora-bn", "aurora-engine-sdk", "aurora-engine-types", "borsh 0.8.2", @@ -156,6 +144,7 @@ dependencies = [ "serde_json", "sha2 0.10.2", "sha3 0.10.2", + "zeropool-bn", ] [[package]] @@ -1506,10 +1495,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if 1.0.0", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -1827,6 +1814,9 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] [[package]] name = "lazycell" @@ -2425,6 +2415,7 @@ dependencies = [ "serde", "sha2 0.9.9", "sha3 0.9.1", + "zeropool-bn", ] [[package]] @@ -3798,6 +3789,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4883,6 +4880,20 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zeropool-bn" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" +dependencies = [ + "borsh 0.9.3", + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + [[package]] name = "zstd-sys" version = "1.6.3+zstd.1.5.2" diff --git a/engine-precompiles/Cargo.toml b/engine-precompiles/Cargo.toml index e5401f0f1..39ebf03a4 100644 --- a/engine-precompiles/Cargo.toml +++ b/engine-precompiles/Cargo.toml @@ -16,7 +16,7 @@ autobenches = false aurora-engine-types = { path = "../engine-types", default-features = false } aurora-engine-sdk = { path = "../engine-sdk", default-features = false } borsh = { version = "0.8.2", default-features = false } -bn = { package = "aurora-bn", git = "https://github.com/aurora-is-near/aurora-bn.git", default-features = false } +bn = { version = "0.5.11", package = "zeropool-bn", default-features = false } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", tag = "v0.36.0-aurora", default-features = false } libsecp256k1 = { version = "0.7.0", default-features = false, features = ["static-context", "hmac"] } num = { version = "0.4.0", default-features = false, features = ["alloc"] } @@ -32,6 +32,7 @@ serde_json = "1" rand = "0.7.3" [features] +default = ["std"] std = ["aurora-engine-types/std", "aurora-engine-sdk/std", "borsh/std", "bn/std", "evm/std", "libsecp256k1/std", "ripemd/std", "sha2/std", "sha3/std", "ethabi/std"] contract = [] log = [] diff --git a/engine-precompiles/src/bn128.rs b/engine-precompiles/src/alt_bn256.rs similarity index 65% rename from engine-precompiles/src/bn128.rs rename to engine-precompiles/src/alt_bn256.rs index a61e9530d..dbb99f528 100644 --- a/engine-precompiles/src/bn128.rs +++ b/engine-precompiles/src/alt_bn256.rs @@ -1,4 +1,3 @@ -use crate::bn128::consts::PAIR_ELEMENT_LEN; use crate::prelude::types::{Address, EthGas}; use crate::prelude::{Borrowed, PhantomData, Vec}; use crate::utils; @@ -36,6 +35,9 @@ mod costs { /// bn128 constants. mod consts { + use crate::prelude::Borrowed; + use evm::ExitError; + /// Input length for the add operation. pub(super) const ADD_INPUT_LEN: usize = 128; @@ -44,23 +46,119 @@ mod consts { /// Pair element length. pub(super) const PAIR_ELEMENT_LEN: usize = 192; + + pub(super) const SCALAR_PART_LEN: usize = SCALAR_LEN / 2; + + /// Size of BN scalars. + pub(super) const SCALAR_LEN: usize = 32; + + /// Half the size of a point size. + pub(super) const POINT_PART_LEN: usize = POINT_LEN / 2; + + /// Size of BN points. + pub(super) const POINT_LEN: usize = 64; + + /// Size of BN pairs. + pub(super) const POINT_PAIR_LEN: usize = 128; + + /// Output length. + pub(super) const OUTPUT_LEN: usize = 64; + + // pub(super) const ERR_BIG_ENDIAN: &str = "ERR_BIG_ENDIAN"; + + pub(super) const ERR_BIG_ENDIAN: ExitError = ExitError::Other(Borrowed("ERR_BIG_ENDIAN")); +} + +#[cfg(feature = "contract")] +trait HostFnEncode { + type Encoded; + + fn host_fn_encode(self) -> Self::Encoded; +} + +#[cfg(feature = "contract")] +fn concat_low_high(low: [u8; P], high: [u8; P]) -> [u8; S] { + let mut bytes = [0u8; S]; + bytes[0..P].copy_from_slice(&low); + bytes[P..P * 2].copy_from_slice(&high); + bytes +} + +#[cfg(feature = "contract")] +impl HostFnEncode for bn::Fr { + type Encoded = [u8; consts::SCALAR_LEN]; + + fn host_fn_encode(self) -> Self::Encoded { + let [low, high] = self.into_u256().0; + concat_low_high(low.to_le_bytes(), high.to_le_bytes()) + } +} + +#[cfg(feature = "contract")] +impl HostFnEncode for bn::Fq { + type Encoded = [u8; consts::SCALAR_LEN]; + + fn host_fn_encode(self) -> Self::Encoded { + let [low, high] = self.into_u256().0; + concat_low_high(low.to_le_bytes(), high.to_le_bytes()) + } +} + +#[cfg(feature = "contract")] +impl HostFnEncode for bn::Fq2 { + type Encoded = [u8; consts::SCALAR_LEN * 2]; + + fn host_fn_encode(self) -> Self::Encoded { + let [real_low, real_high] = self.real().into_u256().0; + let real: [u8; consts::SCALAR_LEN] = + concat_low_high(real_low.to_le_bytes(), real_high.to_le_bytes()); + + let [imaginary_low, imaginary_high] = self.imaginary().into_u256().0; + let imaginary: [u8; consts::SCALAR_LEN] = + concat_low_high(imaginary_low.to_le_bytes(), imaginary_high.to_le_bytes()); + concat_low_high(real, imaginary) + } +} + +#[cfg(feature = "contract")] +impl HostFnEncode for bn::G1 { + type Encoded = [u8; consts::POINT_LEN]; + + fn host_fn_encode(self) -> Self::Encoded { + bn::AffineG1::from_jacobian(self) + .map(|p| { + let (px, py) = (p.x().host_fn_encode(), p.y().host_fn_encode()); + concat_low_high(px, py) + }) + .unwrap_or_else(|| [0u8; consts::POINT_LEN]) + } +} + +#[cfg(feature = "contract")] +impl HostFnEncode for bn::G2 { + type Encoded = [u8; consts::POINT_PAIR_LEN]; + + fn host_fn_encode(self) -> Self::Encoded { + bn::AffineG2::from_jacobian(self) + .map(|g2| { + let x = g2.x().host_fn_encode(); + let y = g2.y().host_fn_encode(); + concat_low_high(x, y) + }) + .unwrap_or_else(|| [0u8; consts::POINT_PAIR_LEN]) + } } /// Reads the `x` and `y` points from an input at a given position. fn read_point(input: &[u8], pos: usize) -> Result { use bn::{AffineG1, Fq, Group, G1}; - let mut px_buf = [0u8; 32]; - px_buf.copy_from_slice(&input[pos..(pos + 32)]); - let px = - Fq::interpret(&px_buf).map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_X")))?; - - let mut py_buf = [0u8; 32]; - py_buf.copy_from_slice(&input[(pos + 32)..(pos + 64)]); - let py = - Fq::interpret(&py_buf).map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_Y")))?; + let px = Fq::from_slice(&input[pos..(pos + consts::SCALAR_LEN)]) + .map_err(|_e| ExitError::Other(Borrowed("ERR_FQ_INCORRECT")))?; + let py = Fq::from_slice(&input[(pos + consts::SCALAR_LEN)..(pos + consts::SCALAR_LEN * 2)]) + .map_err(|_e| ExitError::Other(Borrowed("ERR_FQ_INCORRECT")))?; - Ok(if px == Fq::zero() && py == bn::Fq::zero() { + Ok(if px == Fq::zero() && py == Fq::zero() { G1::zero() } else { AffineG1::new(px, py) @@ -69,9 +167,9 @@ fn read_point(input: &[u8], pos: usize) -> Result { }) } -pub(super) struct Bn128Add(PhantomData); +pub(super) struct Bn256Add(PhantomData); -impl Bn128Add { +impl Bn256Add { pub(super) const ADDRESS: Address = super::make_address(0, 6); pub fn new() -> Self { @@ -79,29 +177,42 @@ impl Bn128Add { } } -impl Bn128Add { +impl Bn256Add { fn run_inner(input: &[u8], _context: &Context) -> Result, ExitError> { - use bn::AffineG1; - let mut input = input.to_vec(); input.resize(consts::ADD_INPUT_LEN, 0); let p1 = read_point(&input, 0)?; - let p2 = read_point(&input, 64)?; - - let mut output = [0u8; 64]; - if let Some(sum) = AffineG1::from_jacobian(p1 + p2) { - let x = sum.x().into_u256().to_big_endian(); - let y = sum.y().into_u256().to_big_endian(); - output[0..32].copy_from_slice(&x); - output[32..64].copy_from_slice(&y); - } + let p2 = read_point(&input, consts::POINT_LEN)?; + let output = Self::execute(p1, p2)?; Ok(output.to_vec()) } + + #[cfg(not(feature = "contract"))] + fn execute(p1: bn::G1, p2: bn::G1) -> Result<[u8; consts::OUTPUT_LEN], ExitError> { + let mut output = [0u8; consts::POINT_LEN]; + if let Some(sum) = bn::AffineG1::from_jacobian(p1 + p2) { + sum.x() + .to_big_endian(&mut output[0..consts::SCALAR_LEN]) + .map_err(|_e| consts::ERR_BIG_ENDIAN)?; + sum.y() + .to_big_endian(&mut output[consts::SCALAR_LEN..consts::SCALAR_LEN * 2]) + .map_err(|_e| consts::ERR_BIG_ENDIAN)?; + } + Ok(output) + } + + #[cfg(feature = "contract")] + fn execute(p1: bn::G1, p2: bn::G1) -> Result<[u8; consts::OUTPUT_LEN], ExitError> { + Ok(aurora_engine_sdk::alt_bn128_g1_sum( + p1.host_fn_encode(), + p2.host_fn_encode(), + )) + } } -impl Precompile for Bn128Add { +impl Precompile for Bn256Add { fn required_gas(_input: &[u8]) -> Result { Ok(costs::BYZANTIUM_ADD) } @@ -130,7 +241,7 @@ impl Precompile for Bn128Add { } } -impl Precompile for Bn128Add { +impl Precompile for Bn256Add { fn required_gas(_input: &[u8]) -> Result { Ok(costs::ISTANBUL_ADD) } @@ -158,9 +269,9 @@ impl Precompile for Bn128Add { } } -pub(super) struct Bn128Mul(PhantomData); +pub(super) struct Bn256Mul(PhantomData); -impl Bn128Mul { +impl Bn256Mul { pub(super) const ADDRESS: Address = super::make_address(0, 7); pub fn new() -> Self { @@ -168,32 +279,46 @@ impl Bn128Mul { } } -impl Bn128Mul { +impl Bn256Mul { fn run_inner(input: &[u8], _context: &Context) -> Result, ExitError> { - use bn::AffineG1; - let mut input = input.to_vec(); input.resize(consts::MUL_INPUT_LEN, 0); let p = read_point(&input, 0)?; - let mut fr_buf = [0u8; 32]; - fr_buf.copy_from_slice(&input[64..96]); - let fr = bn::Fr::interpret(&fr_buf) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_FE")))?; - - let mut output = [0u8; 64]; - if let Some(mul) = AffineG1::from_jacobian(p * fr) { - let x = mul.x().into_u256().to_big_endian(); - let y = mul.y().into_u256().to_big_endian(); - output[0..32].copy_from_slice(&x); - output[32..64].copy_from_slice(&y); - } + let fr = + bn::Fr::from_slice(&input[consts::POINT_LEN..consts::POINT_LEN + consts::SCALAR_LEN]) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_FR")))?; + let output = Self::execute(p, fr)?; Ok(output.to_vec()) } + + #[cfg(not(feature = "contract"))] + fn execute(p: bn::G1, fr: bn::Fr) -> Result<[u8; consts::OUTPUT_LEN], ExitError> { + let mut output = [0u8; consts::OUTPUT_LEN]; + if let Some(mul) = bn::AffineG1::from_jacobian(p * fr) { + mul.x() + .into_u256() + .to_big_endian(&mut output[0..consts::SCALAR_LEN]) + .map_err(|_e| consts::ERR_BIG_ENDIAN)?; + mul.y() + .into_u256() + .to_big_endian(&mut output[consts::SCALAR_LEN..consts::SCALAR_LEN * 2]) + .map_err(|_e| consts::ERR_BIG_ENDIAN)?; + } + Ok(output) + } + + #[cfg(feature = "contract")] + fn execute(g1: bn::G1, fr: bn::Fr) -> Result<[u8; consts::OUTPUT_LEN], ExitError> { + Ok(aurora_engine_sdk::alt_bn128_g1_scalar_multiple( + g1.host_fn_encode(), + fr.host_fn_encode(), + )) + } } -impl Precompile for Bn128Mul { +impl Precompile for Bn256Mul { fn required_gas(_input: &[u8]) -> Result { Ok(costs::BYZANTIUM_MUL) } @@ -221,7 +346,7 @@ impl Precompile for Bn128Mul { } } -impl Precompile for Bn128Mul { +impl Precompile for Bn256Mul { fn required_gas(_input: &[u8]) -> Result { Ok(costs::ISTANBUL_MUL) } @@ -249,9 +374,9 @@ impl Precompile for Bn128Mul { } } -pub(super) struct Bn128Pair(PhantomData); +pub(super) struct Bn256Pair(PhantomData); -impl Bn128Pair { +impl Bn256Pair { pub(super) const ADDRESS: Address = super::make_address(0, 8); pub fn new() -> Self { @@ -259,104 +384,97 @@ impl Bn128Pair { } } -impl Bn128Pair { +impl Bn256Pair { fn run_inner(input: &[u8], _context: &Context) -> Result, ExitError> { - use bn::{arith::U256, AffineG1, AffineG2, Fq, Fq2, Group, Gt, G1, G2}; - if input.len() % consts::PAIR_ELEMENT_LEN != 0 { return Err(ExitError::Other(Borrowed("ERR_BN128_INVALID_LEN"))); } let output = if input.is_empty() { - U256::one() + bn::arith::U256::one() } else { let elements = input.len() / consts::PAIR_ELEMENT_LEN; let mut vals = Vec::with_capacity(elements); - for idx in 0..elements { - let mut buf = [0u8; 32]; - - buf.copy_from_slice( - &input[(idx * consts::PAIR_ELEMENT_LEN)..(idx * consts::PAIR_ELEMENT_LEN + 32)], - ); - let ax = Fq::interpret(&buf) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_AX")))?; - buf.copy_from_slice( - &input[(idx * consts::PAIR_ELEMENT_LEN + 32) - ..(idx * consts::PAIR_ELEMENT_LEN + 64)], - ); - let ay = Fq::interpret(&buf) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_AY")))?; - buf.copy_from_slice( - &input[(idx * consts::PAIR_ELEMENT_LEN + 64) - ..(idx * consts::PAIR_ELEMENT_LEN + 96)], - ); - let bay = Fq::interpret(&buf) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_B_AY")))?; - buf.copy_from_slice( - &input[(idx * consts::PAIR_ELEMENT_LEN + 96) - ..(idx * consts::PAIR_ELEMENT_LEN + 128)], - ); - let bax = Fq::interpret(&buf) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_B_AX")))?; - buf.copy_from_slice( - &input[(idx * consts::PAIR_ELEMENT_LEN + 128) - ..(idx * consts::PAIR_ELEMENT_LEN + 160)], - ); - let bby = Fq::interpret(&buf) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_B_BY")))?; - buf.copy_from_slice( - &input[(idx * consts::PAIR_ELEMENT_LEN + 160) - ..(idx * consts::PAIR_ELEMENT_LEN + 192)], - ); - let bbx = Fq::interpret(&buf) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_B_BX")))?; - - let a = { - if ax.is_zero() && ay.is_zero() { - G1::zero() - } else { - G1::from( - AffineG1::new(ax, ay) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_A")))?, - ) - } - }; - let b = { - let ba = Fq2::new(bax, bay); - let bb = Fq2::new(bbx, bby); - - if ba.is_zero() && bb.is_zero() { - G2::zero() - } else { - G2::from( - AffineG2::new(ba, bb) - .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_B")))?, - ) - } + let ax = bn::Fq::from_slice( + &input[(idx * consts::PAIR_ELEMENT_LEN) + ..(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN)], + ) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_AX")))?; + let ay = bn::Fq::from_slice( + &input[(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN) + ..(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 2)], + ) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_AY")))?; + let bay = bn::Fq::from_slice( + &input[(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 2) + ..(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 3)], + ) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_BAY")))?; + let bax = bn::Fq::from_slice( + &input[(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 3) + ..(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 4)], + ) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_BAX")))?; + let bby = bn::Fq::from_slice( + &input[(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 4) + ..(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 5)], + ) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_BBY")))?; + let bbx = bn::Fq::from_slice( + &input[(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 5) + ..(idx * consts::PAIR_ELEMENT_LEN + consts::SCALAR_LEN * 6)], + ) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_BBX")))?; + + let g1_a = bn::AffineG1::new(ax, ay) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_A")))? + .into(); + let g1_b = { + let ba = bn::Fq2::new(bax, bay); + let bb = bn::Fq2::new(bbx, bby); + + bn::AffineG2::new(ba, bb) + .map_err(|_e| ExitError::Other(Borrowed("ERR_BN128_INVALID_B")))? + .into() }; - vals.push((a, b)) + vals.push((g1_a, g1_b)) } - let mul = vals - .into_iter() - .fold(Gt::one(), |s, (a, b)| s * bn::pairing(a, b)); - - if mul == Gt::one() { - U256::one() + let result = Self::execute(vals); + if result { + bn::arith::U256::one() } else { - U256::zero() + bn::arith::U256::zero() } }; - Ok(output.to_big_endian().to_vec()) + let mut res = crate::vec![0u8; 32]; + output + .to_big_endian(&mut res[0..32]) + .map_err(|_e| consts::ERR_BIG_ENDIAN)?; + Ok(res) + } + + #[cfg(not(feature = "contract"))] + fn execute(vals: Vec<(bn::G1, bn::G2)>) -> bool { + bn::pairing_batch(&vals) == bn::Gt::one() + } + + #[cfg(feature = "contract")] + fn execute(vals: Vec<(bn::G1, bn::G2)>) -> bool { + let points = vals + .into_iter() + .map(|(g1, g2)| (g1.host_fn_encode(), g2.host_fn_encode())); + aurora_engine_sdk::alt_bn128_pairing(points) } } -impl Precompile for Bn128Pair { +impl Precompile for Bn256Pair { fn required_gas(input: &[u8]) -> Result { let input_len = u64::try_from(input.len()).map_err(utils::err_usize_conv)?; - let pair_element_len = u64::try_from(PAIR_ELEMENT_LEN).map_err(utils::err_usize_conv)?; + let pair_element_len = + u64::try_from(consts::PAIR_ELEMENT_LEN).map_err(utils::err_usize_conv)?; Ok( costs::BYZANTIUM_PAIR_PER_POINT * input_len / pair_element_len + costs::BYZANTIUM_PAIR_BASE, @@ -386,10 +504,11 @@ impl Precompile for Bn128Pair { } } -impl Precompile for Bn128Pair { +impl Precompile for Bn256Pair { fn required_gas(input: &[u8]) -> Result { let input_len = u64::try_from(input.len()).map_err(utils::err_usize_conv)?; - let pair_element_len = u64::try_from(PAIR_ELEMENT_LEN).map_err(utils::err_usize_conv)?; + let pair_element_len = + u64::try_from(consts::PAIR_ELEMENT_LEN).map_err(utils::err_usize_conv)?; Ok( costs::ISTANBUL_PAIR_PER_POINT * input_len / pair_element_len + costs::ISTANBUL_PAIR_BASE, @@ -442,7 +561,7 @@ mod tests { ) .unwrap(); - let res = Bn128Add::::new() + let res = Bn256Add::::new() .run(&input, Some(EthGas::new(500)), &new_context(), false) .unwrap() .output; @@ -464,7 +583,7 @@ mod tests { ) .unwrap(); - let res = Bn128Add::::new() + let res = Bn256Add::::new() .run(&input, Some(EthGas::new(500)), &new_context(), false) .unwrap() .output; @@ -480,7 +599,7 @@ mod tests { ) .unwrap(); let res = - Bn128Add::::new().run(&input, Some(EthGas::new(499)), &new_context(), false); + Bn256Add::::new().run(&input, Some(EthGas::new(499)), &new_context(), false); assert!(matches!(res, Err(ExitError::OutOfGas))); // no input test @@ -492,7 +611,7 @@ mod tests { ) .unwrap(); - let res = Bn128Add::::new() + let res = Bn256Add::::new() .run(&input, Some(EthGas::new(500)), &new_context(), false) .unwrap() .output; @@ -509,7 +628,7 @@ mod tests { .unwrap(); let res = - Bn128Add::::new().run(&input, Some(EthGas::new(500)), &new_context(), false); + Bn256Add::::new().run(&input, Some(EthGas::new(500)), &new_context(), false); assert!(matches!( res, Err(ExitError::Other(Borrowed("ERR_BN128_INVALID_POINT"))) @@ -532,7 +651,7 @@ mod tests { ) .unwrap(); - let res = Bn128Mul::::new() + let res = Bn256Mul::::new() .run(&input, Some(EthGas::new(40_000)), &new_context(), false) .unwrap() .output; @@ -546,7 +665,7 @@ mod tests { 0200000000000000000000000000000000000000000000000000000000000000", ) .unwrap(); - let res = Bn128Mul::::new().run( + let res = Bn256Mul::::new().run( &input, Some(EthGas::new(39_999)), &new_context(), @@ -569,7 +688,7 @@ mod tests { ) .unwrap(); - let res = Bn128Mul::::new() + let res = Bn256Mul::::new() .run(&input, Some(EthGas::new(40_000)), &new_context(), false) .unwrap() .output; @@ -584,7 +703,7 @@ mod tests { ) .unwrap(); - let res = Bn128Mul::::new() + let res = Bn256Mul::::new() .run(&input, Some(EthGas::new(40_000)), &new_context(), false) .unwrap() .output; @@ -599,7 +718,7 @@ mod tests { ) .unwrap(); - let res = Bn128Mul::::new().run( + let res = Bn256Mul::::new().run( &input, Some(EthGas::new(40_000)), &new_context(), @@ -633,7 +752,7 @@ mod tests { hex::decode("0000000000000000000000000000000000000000000000000000000000000001") .unwrap(); - let res = Bn128Pair::::new() + let res = Bn256Pair::::new() .run(&input, Some(EthGas::new(260_000)), &new_context(), false) .unwrap() .output; @@ -656,7 +775,7 @@ mod tests { 12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa", ) .unwrap(); - let res = Bn128Pair::::new().run( + let res = Bn256Pair::::new().run( &input, Some(EthGas::new(259_999)), &new_context(), @@ -670,7 +789,7 @@ mod tests { hex::decode("0000000000000000000000000000000000000000000000000000000000000001") .unwrap(); - let res = Bn128Pair::::new() + let res = Bn256Pair::::new() .run(&input, Some(EthGas::new(260_000)), &new_context(), false) .unwrap() .output; @@ -688,7 +807,7 @@ mod tests { ) .unwrap(); - let res = Bn128Pair::::new().run( + let res = Bn256Pair::::new().run( &input, Some(EthGas::new(260_000)), &new_context(), @@ -709,7 +828,7 @@ mod tests { ) .unwrap(); - let res = Bn128Pair::::new().run( + let res = Bn256Pair::::new().run( &input, Some(EthGas::new(260_000)), &new_context(), diff --git a/engine-precompiles/src/lib.rs b/engine-precompiles/src/lib.rs index 73ce32444..10ab661e7 100644 --- a/engine-precompiles/src/lib.rs +++ b/engine-precompiles/src/lib.rs @@ -4,8 +4,8 @@ #![deny(clippy::as_conversions)] pub mod account_ids; +pub mod alt_bn256; pub mod blake2; -pub mod bn128; pub mod hash; pub mod identity; pub mod modexp; @@ -18,8 +18,8 @@ pub mod secp256k1; mod utils; use crate::account_ids::{predecessor_account, CurrentAccount, PredecessorAccount}; +use crate::alt_bn256::{Bn256Add, Bn256Mul, Bn256Pair}; use crate::blake2::Blake2F; -use crate::bn128::{Bn128Add, Bn128Mul, Bn128Pair}; use crate::hash::{RIPEMD160, SHA256}; use crate::identity::Identity; use crate::modexp::ModExp; @@ -182,9 +182,9 @@ impl<'a, I: IO + Copy, E: Env, H: ReadOnlyPromiseHandler> Precompiles<'a, I, E, RIPEMD160::ADDRESS, Identity::ADDRESS, ModExp::::ADDRESS, - Bn128Add::::ADDRESS, - Bn128Mul::::ADDRESS, - Bn128Pair::::ADDRESS, + Bn256Add::::ADDRESS, + Bn256Mul::::ADDRESS, + Bn256Pair::::ADDRESS, RandomSeed::ADDRESS, CurrentAccount::ADDRESS, ]; @@ -194,9 +194,9 @@ impl<'a, I: IO + Copy, E: Env, H: ReadOnlyPromiseHandler> Precompiles<'a, I, E, Box::new(RIPEMD160), Box::new(Identity), Box::new(ModExp::::new()), - Box::new(Bn128Add::::new()), - Box::new(Bn128Mul::::new()), - Box::new(Bn128Pair::::new()), + Box::new(Bn256Add::::new()), + Box::new(Bn256Mul::::new()), + Box::new(Bn256Pair::::new()), Box::new(RandomSeed::new(ctx.random_seed)), Box::new(CurrentAccount::new(ctx.current_account_id.clone())), ]; @@ -212,9 +212,9 @@ impl<'a, I: IO + Copy, E: Env, H: ReadOnlyPromiseHandler> Precompiles<'a, I, E, RIPEMD160::ADDRESS, Identity::ADDRESS, ModExp::::ADDRESS, - Bn128Add::::ADDRESS, - Bn128Mul::::ADDRESS, - Bn128Pair::::ADDRESS, + Bn256Add::::ADDRESS, + Bn256Mul::::ADDRESS, + Bn256Pair::::ADDRESS, Blake2F::ADDRESS, RandomSeed::ADDRESS, CurrentAccount::ADDRESS, @@ -225,9 +225,9 @@ impl<'a, I: IO + Copy, E: Env, H: ReadOnlyPromiseHandler> Precompiles<'a, I, E, Box::new(RIPEMD160), Box::new(Identity), Box::new(ModExp::::new()), - Box::new(Bn128Add::::new()), - Box::new(Bn128Mul::::new()), - Box::new(Bn128Pair::::new()), + Box::new(Bn256Add::::new()), + Box::new(Bn256Mul::::new()), + Box::new(Bn256Pair::::new()), Box::new(Blake2F), Box::new(RandomSeed::new(ctx.random_seed)), Box::new(CurrentAccount::new(ctx.current_account_id.clone())), @@ -244,9 +244,9 @@ impl<'a, I: IO + Copy, E: Env, H: ReadOnlyPromiseHandler> Precompiles<'a, I, E, RIPEMD160::ADDRESS, Identity::ADDRESS, ModExp::::ADDRESS, - Bn128Add::::ADDRESS, - Bn128Mul::::ADDRESS, - Bn128Pair::::ADDRESS, + Bn256Add::::ADDRESS, + Bn256Mul::::ADDRESS, + Bn256Pair::::ADDRESS, Blake2F::ADDRESS, RandomSeed::ADDRESS, CurrentAccount::ADDRESS, @@ -257,9 +257,9 @@ impl<'a, I: IO + Copy, E: Env, H: ReadOnlyPromiseHandler> Precompiles<'a, I, E, Box::new(RIPEMD160), Box::new(Identity), Box::new(ModExp::::new()), - Box::new(Bn128Add::::new()), - Box::new(Bn128Mul::::new()), - Box::new(Bn128Pair::::new()), + Box::new(Bn256Add::::new()), + Box::new(Bn256Mul::::new()), + Box::new(Bn256Pair::::new()), Box::new(Blake2F), Box::new(RandomSeed::new(ctx.random_seed)), Box::new(CurrentAccount::new(ctx.current_account_id.clone())), @@ -399,9 +399,9 @@ mod tests { assert_eq!(super::hash::RIPEMD160::ADDRESS, u8_to_address(3)); assert_eq!(super::identity::Identity::ADDRESS, u8_to_address(4)); assert_eq!(super::ModExp::::ADDRESS, u8_to_address(5)); - assert_eq!(super::Bn128Add::::ADDRESS, u8_to_address(6)); - assert_eq!(super::Bn128Mul::::ADDRESS, u8_to_address(7)); - assert_eq!(super::Bn128Pair::::ADDRESS, u8_to_address(8)); + assert_eq!(super::Bn256Add::::ADDRESS, u8_to_address(6)); + assert_eq!(super::Bn256Mul::::ADDRESS, u8_to_address(7)); + assert_eq!(super::Bn256Pair::::ADDRESS, u8_to_address(8)); assert_eq!(super::blake2::Blake2F::ADDRESS, u8_to_address(9)); } diff --git a/engine-sdk/src/lib.rs b/engine-sdk/src/lib.rs index 97beb87e5..fd20909d5 100644 --- a/engine-sdk/src/lib.rs +++ b/engine-sdk/src/lib.rs @@ -2,7 +2,7 @@ #![cfg_attr(not(feature = "std"), feature(alloc_error_handler))] #[cfg(feature = "contract")] -use crate::prelude::Address; +use crate::prelude::{Address, Vec, U256}; use crate::prelude::{H256, STORAGE_PRICE_PER_BYTE}; pub use types::keccak; @@ -45,9 +45,10 @@ pub fn log_utf8(bytes: &[u8]) { #[cfg(feature = "contract")] pub fn sha256(input: &[u8]) -> H256 { unsafe { + const REGISTER_ID: u64 = 1; exports::sha256(input.len() as u64, input.as_ptr() as u64, 1); let bytes = H256::zero(); - exports::read_register(1, bytes.0.as_ptr() as *const u64 as u64); + exports::read_register(REGISTER_ID, bytes.0.as_ptr() as *const u64 as u64); bytes } } @@ -72,6 +73,75 @@ pub fn ripemd160(input: &[u8]) -> [u8; 20] { } } +#[cfg(feature = "contract")] +pub fn alt_bn128_g1_sum(left: [u8; 64], right: [u8; 64]) -> [u8; 64] { + let mut bytes = Vec::with_capacity(64 * 2 + 2); // 64 bytes per G1 + 2 positive integer bytes. + + bytes.push(0); // positive sign + bytes.extend_from_slice(&left); + bytes.push(0); + bytes.extend_from_slice(&right); + + let value_ptr = bytes.as_ptr() as u64; + let value_len = bytes.len() as u64; + + unsafe { + const REGISTER_ID: u64 = 1; + exports::alt_bn128_g1_sum(value_len, value_ptr, REGISTER_ID); + let mut output = [0u8; 64]; + exports::read_register(REGISTER_ID, output.as_ptr() as u64); + let x = U256::from_little_endian(&output[0..32]); + let y = U256::from_little_endian(&output[32..64]); + x.to_big_endian(&mut output[0..32]); + y.to_big_endian(&mut output[32..64]); + output + } +} + +#[cfg(feature = "contract")] +pub fn alt_bn128_g1_scalar_multiple(g1: [u8; 64], fr: [u8; 32]) -> [u8; 64] { + let mut bytes = [0u8; 96]; + bytes[0..64].copy_from_slice(&g1); + bytes[64..96].copy_from_slice(&fr); + + let value_ptr = bytes.as_ptr() as u64; + let value_len = bytes.len() as u64; + + unsafe { + const REGISTER_ID: u64 = 1; + exports::alt_bn128_g1_multiexp(value_len, value_ptr, REGISTER_ID); + let mut output = [0u8; 64]; + exports::read_register(REGISTER_ID, output.as_ptr() as u64); + let x = U256::from_little_endian(&output[0..32]); + let y = U256::from_little_endian(&output[32..64]); + x.to_big_endian(&mut output[0..32]); + y.to_big_endian(&mut output[32..64]); + output + } +} + +#[cfg(feature = "contract")] +pub fn alt_bn128_pairing(pairs: I) -> bool +where + I: ExactSizeIterator, +{ + let n = pairs.len(); + let mut bytes = Vec::with_capacity(n * 6 * 32); + let mut buf = [0u8; 64 + 128]; + for (g1, g2) in pairs { + buf[0..64].copy_from_slice(&g1); + buf[64..192].copy_from_slice(&g2); + bytes.extend_from_slice(&buf); + } + + let value_ptr = bytes.as_ptr() as u64; + let value_len = bytes.len() as u64; + + let result = unsafe { exports::alt_bn128_pairing_check(value_len, value_ptr) }; + + result == 1 +} + /// Recover address from message hash and signature. #[cfg(feature = "contract")] pub fn ecrecover(hash: H256, signature: &[u8]) -> Result { diff --git a/engine-sdk/src/near_runtime.rs b/engine-sdk/src/near_runtime.rs index 7852fd978..20844dffe 100644 --- a/engine-sdk/src/near_runtime.rs +++ b/engine-sdk/src/near_runtime.rs @@ -478,6 +478,9 @@ pub(crate) mod exports { malleability_flag: u64, register_id: u64, ) -> u64; + pub(crate) fn alt_bn128_g1_sum(value_len: u64, value_ptr: u64, register_id: u64); + pub(crate) fn alt_bn128_g1_multiexp(value_len: u64, value_ptr: u64, register_id: u64); + pub(crate) fn alt_bn128_pairing_check(value_len: u64, value_ptr: u64) -> u64; // ##################### // # Miscellaneous API # // ##################### diff --git a/engine-sdk/src/prelude.rs b/engine-sdk/src/prelude.rs index 799b5ec86..118ef3ef4 100644 --- a/engine-sdk/src/prelude.rs +++ b/engine-sdk/src/prelude.rs @@ -1,3 +1,3 @@ pub use aurora_engine_types::types::{Address, NearGas, PromiseResult, STORAGE_PRICE_PER_BYTE}; -pub use aurora_engine_types::{vec, Vec, H256}; +pub use aurora_engine_types::{vec, Vec, H256, U256}; pub use borsh::{BorshDeserialize, BorshSerialize}; diff --git a/engine-tests/Cargo.toml b/engine-tests/Cargo.toml index 6506d212a..3d9863ffe 100644 --- a/engine-tests/Cargo.toml +++ b/engine-tests/Cargo.toml @@ -38,10 +38,10 @@ hex = { version = "0.4.3", default-features = false } near-sdk = { git = "https://github.com/aurora-is-near/near-sdk-rs.git", rev = "ba2eddbfbf4484ac3e44b4c8119bbac4907d6e07" } near-sdk-sim = { git = "https://github.com/aurora-is-near/near-sdk-rs.git", rev = "ba2eddbfbf4484ac3e44b4c8119bbac4907d6e07" } near-crypto = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda" } -near-vm-runner = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda", default-features = false, features = [ "wasmer2_vm" ] } -near-vm-logic = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda" } -near-primitives-core = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda" } -near-primitives = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda" } +near-vm-runner = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda", default-features = false, features = [ "wasmer2_vm", "protocol_feature_alt_bn128" ] } +near-vm-logic = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda", default-features = false, features = [ "protocol_feature_alt_bn128" ] } +near-primitives-core = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda", features = [ "protocol_feature_alt_bn128" ] } +near-primitives = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda", default-features = false, features = [ "nightly_protocol" ] } libsecp256k1 = { version = "0.7.0", default-features = false } rand = "0.8.5" criterion = "0.3.4" diff --git a/engine-tests/src/test_utils/standard_precompiles.rs b/engine-tests/src/test_utils/standard_precompiles.rs index 1468bc0a0..bf85dcdb8 100644 --- a/engine-tests/src/test_utils/standard_precompiles.rs +++ b/engine-tests/src/test_utils/standard_precompiles.rs @@ -49,8 +49,7 @@ impl PrecompilesContract { "test_modexp", "test_ecadd", "test_ecmul", - // TODO(#46): ecpair uses up all the gas (by itself) for some reason, need to look into this. - // "test_ecpair", + "test_ecpair", "test_blake2f", "test_all", ] diff --git a/engine-tests/src/tests/standard_precompiles.rs b/engine-tests/src/tests/standard_precompiles.rs index 3d94293c9..94454ba63 100644 --- a/engine-tests/src/tests/standard_precompiles.rs +++ b/engine-tests/src/tests/standard_precompiles.rs @@ -2,14 +2,22 @@ use crate::prelude::Wei; use crate::test_utils::{ self, standard_precompiles::{PrecompilesConstructor, PrecompilesContract}, - AuroraRunner, Signer, + AuroraRunner, ExecutionProfile, Signer, }; const INITIAL_BALANCE: Wei = Wei::new_u64(1000); const INITIAL_NONCE: u64 = 0; +fn precompile_execution_profile(method: &str) -> ExecutionProfile { + let (mut runner, mut signer, contract) = initialize(); + let (_result, profile) = runner + .submit_with_signer_profiled(&mut signer, |nonce| contract.call_method(method, nonce)) + .unwrap(); + profile +} + #[test] -fn standard_precompiles() { +fn test_standard_precompiles() { let (mut runner, mut signer, contract) = initialize(); let outcome = runner @@ -20,21 +28,57 @@ fn standard_precompiles() { } #[test] -#[ignore] -fn ecpair() { - let (mut runner, mut signer, contract) = initialize(); +fn profile_ecrecover() { + let profile = precompile_execution_profile("test_ecrecover"); + test_utils::assert_gas_bound(profile.all_gas(), 6); +} - // TODO(#46): This should fit into 200 Tgas; we should not need to increase the limit like this. - runner.wasm_config.limit_config.max_gas_burnt = u64::MAX; - let (_result, profile) = runner - .submit_with_signer_profiled(&mut signer, |nonce| { - contract.call_method("test_ecpair", nonce) - }) - .unwrap(); +#[test] +fn profile_sha256() { + let profile = precompile_execution_profile("test_sha256"); + test_utils::assert_gas_bound(profile.all_gas(), 5); +} + +#[test] +fn profile_ripemd160() { + let profile = precompile_execution_profile("test_ripemd160"); + test_utils::assert_gas_bound(profile.all_gas(), 5); +} + +#[test] +fn profile_identity() { + let profile = precompile_execution_profile("test_identity"); + test_utils::assert_gas_bound(profile.all_gas(), 5); +} + +#[test] +fn profile_modexp() { + let profile = precompile_execution_profile("test_modexp"); + test_utils::assert_gas_bound(profile.all_gas(), 7); +} + +#[test] +fn profile_ecadd() { + let profile = precompile_execution_profile("test_ecadd"); + test_utils::assert_gas_bound(profile.all_gas(), 5); +} - // Some day this number should be less than 200 Tgas. - println!("{:?}", profile.all_gas()); - assert!(profile.all_gas() < 200_000_000_000_000); +#[test] +fn profile_ecmul() { + let profile = precompile_execution_profile("test_ecmul"); + test_utils::assert_gas_bound(profile.all_gas(), 6); +} + +#[test] +fn profile_ecpair() { + let profile = precompile_execution_profile("test_ecpair"); + test_utils::assert_gas_bound(profile.all_gas(), 102); +} + +#[test] +fn profile_blake2f() { + let profile = precompile_execution_profile("test_blake2f"); + test_utils::assert_gas_bound(profile.all_gas(), 6); } fn initialize() -> (AuroraRunner, Signer, PrecompilesContract) { diff --git a/engine-tests/src/tests/uniswap.rs b/engine-tests/src/tests/uniswap.rs index d7bb1b30f..8582de8a9 100644 --- a/engine-tests/src/tests/uniswap.rs +++ b/engine-tests/src/tests/uniswap.rs @@ -28,7 +28,7 @@ fn test_uniswap_input_multihop() { let mut context = UniswapTestContext::new("uniswap"); // evm_gas = 970k - // near total gas = 163 Tgas + // near total gas = 122 Tgas let tokens = context.create_tokens(10, MINT_AMOUNT.into()); for (token_a, token_b) in tokens.iter().zip(tokens.iter().skip(1)) { diff --git a/etc/state-migration-test/Cargo.lock b/etc/state-migration-test/Cargo.lock new file mode 100644 index 000000000..43f8a1762 --- /dev/null +++ b/etc/state-migration-test/Cargo.lock @@ -0,0 +1,1238 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" + +[[package]] +name = "aurora-bn" +version = "0.1.0" +source = "git+https://github.com/aurora-is-near/aurora-bn.git#8f1743884061981cac84388862e2763b2aa09307" +dependencies = [ + "byteorder", + "getrandom", +] + +[[package]] +name = "aurora-engine" +version = "2.6.1" +dependencies = [ + "aurora-bn", + "aurora-engine-precompiles", + "aurora-engine-sdk", + "aurora-engine-transactions", + "aurora-engine-types", + "base64", + "borsh", + "byte-slice-cast", + "ethabi", + "evm", + "evm-core", + "hex", + "libsecp256k1", + "logos", + "num", + "primitive-types 0.10.1", + "ripemd160", + "rjson", + "rlp", + "sha3 0.9.1", + "wee_alloc", +] + +[[package]] +name = "aurora-engine-precompiles" +version = "1.0.0" +dependencies = [ + "aurora-engine-sdk", + "aurora-engine-types", + "base64", + "borsh", + "ethabi", + "evm", + "evm-core", + "hex", + "libsecp256k1", + "num", + "primitive-types 0.11.1", + "ripemd160", + "sha2", + "sha3 0.9.1", + "zeropool-bn", +] + +[[package]] +name = "aurora-engine-sdk" +version = "1.0.0" +dependencies = [ + "aurora-engine-types", + "borsh", + "sha2", + "sha3 0.9.1", +] + +[[package]] +name = "aurora-engine-state-migration-test" +version = "1.0.0" +dependencies = [ + "aurora-engine", + "aurora-engine-sdk", + "aurora-engine-types", + "borsh", +] + +[[package]] +name = "aurora-engine-transactions" +version = "1.0.0" +dependencies = [ + "aurora-engine-precompiles", + "aurora-engine-sdk", + "aurora-engine-types", + "evm", + "hex", + "rlp", +] + +[[package]] +name = "aurora-engine-types" +version = "1.0.0" +dependencies = [ + "borsh", + "ethabi", + "hex", + "primitive-types 0.11.1", + "sha3 0.9.1", +] + +[[package]] +name = "auto_impl" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "beef" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6736e2428df2ca2848d846c43e88745121a6654696e349ce0054a420815a7409" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding", + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "borsh" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a7111f797cc721407885a323fb071636aee57f750b1a4ddc27397eba168a74" +dependencies = [ + "borsh-derive", + "hashbrown", +] + +[[package]] +name = "borsh-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "307f3740906bac2c118a8122fe22681232b244f1369273e45f1156b45c43d2dd" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2104c73179359431cc98e016998f2f23bc7a05bc53e79741bcba705f30047bc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae29eb8418fcd46f723f8691a2ac06857d31179d33d2f2d91eb13967de97c728" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "bumpalo" +version = "3.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" + +[[package]] +name = "byte-slice-cast" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c1bf4a04a88c54f589125563643d773f3254b5c38571395e2b591c693bbc81" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cpufeatures" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed00c67cb5d0a7d64a44f6ad2668db7e7530311dd53ea79bcd4fb022c64911c8" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "derive_more" +version = "0.99.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", +] + +[[package]] +name = "ethabi" +version = "17.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f186de076b3e77b8e6d73c99d1b52edc2a229e604f4b5eb6992c06c11d79d537" +dependencies = [ + "ethereum-types", + "hex", + "sha3 0.10.2", +] + +[[package]] +name = "ethbloom" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec", + "impl-rlp", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23750149fe8834c0e24bb9adcbacbe06c45b9861f15df53e09f26cb7c4ab91ef" +dependencies = [ + "bytes", + "ethereum-types", + "hash-db", + "hash256-std-hasher", + "rlp", + "rlp-derive", + "sha3 0.10.2", + "triehash", +] + +[[package]] +name = "ethereum-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-codec", + "impl-rlp", + "primitive-types 0.11.1", + "scale-info", + "uint", +] + +[[package]] +name = "evm" +version = "0.35.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.36.0-aurora#7dfbeb535e7105a7531a4e6c559f0f5d45f20014" +dependencies = [ + "auto_impl", + "ethereum", + "evm-core", + "evm-gasometer", + "evm-runtime", + "log", + "primitive-types 0.11.1", + "rlp", + "sha3 0.10.2", +] + +[[package]] +name = "evm-core" +version = "0.35.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.36.0-aurora#7dfbeb535e7105a7531a4e6c559f0f5d45f20014" +dependencies = [ + "primitive-types 0.11.1", +] + +[[package]] +name = "evm-gasometer" +version = "0.35.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.36.0-aurora#7dfbeb535e7105a7531a4e6c559f0f5d45f20014" +dependencies = [ + "evm-core", + "evm-runtime", + "primitive-types 0.11.1", +] + +[[package]] +name = "evm-runtime" +version = "0.35.0" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.36.0-aurora#7dfbeb535e7105a7531a4e6c559f0f5d45f20014" +dependencies = [ + "auto_impl", + "evm-core", + "primitive-types 0.11.1", + "sha3 0.10.2", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +dependencies = [ + "ahash", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec 3.1.5", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "js-sys" +version = "0.3.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin", +] + +[[package]] +name = "libc" +version = "0.2.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" + +[[package]] +name = "libsecp256k1" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0452aac8bab02242429380e9b2f94ea20cea2b37e2c1777a1358799bbe97f37" +dependencies = [ + "arrayref", + "base64", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand", + "serde", + "sha2", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "logos" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427e2abca5be13136da9afdbf874e6b34ad9001dd70f2b103b083a85daa7b345" +dependencies = [ + "logos-derive", +] + +[[package]] +name = "logos-derive" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56a7d287fd2ac3f75b11f19a1c8a874a7d55744bd91f7a1b3e7cf87d4343c36d" +dependencies = [ + "beef", + "fnv", + "proc-macro2", + "quote", + "regex-syntax", + "syn", + "utf8-ranges", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "num" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e0d047c1062aa51e256408c560894e5251f08925980e53cf1aa5bd00eec6512" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "parity-scale-codec" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" +dependencies = [ + "arrayvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 2.3.1", +] + +[[package]] +name = "parity-scale-codec" +version = "3.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +dependencies = [ + "arrayvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive 3.1.3", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "primitive-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +dependencies = [ + "fixed-hash", + "impl-rlp", + "uint", +] + +[[package]] +name = "primitive-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-rlp", + "scale-info", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "ripemd160" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "rjson" +version = "0.3.2" +source = "git+https://github.com/aurora-is-near/rjson?rev=cc3da949#cc3da9495e7e520900d66d2b517539f74fff93cf" + +[[package]] +name = "rlp" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54369147e3e7796c9b885c7304db87ca3d09a0a98f72843d532868675bbfba8" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "scale-info" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" +dependencies = [ + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec 2.3.1", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde" +version = "1.0.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", +] + +[[package]] +name = "sha3" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a31480366ec990f395a61b7c08122d99bd40544fdb5abcfc1b06bb29994312c" +dependencies = [ + "digest 0.10.3", + "keccak", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" + +[[package]] +name = "syn" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "thiserror" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "toml" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde", +] + +[[package]] +name = "triehash" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" +dependencies = [ + "hash-db", + "rlp", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "uint" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "utf8-ranges" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" + +[[package]] +name = "version_check" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "zeropool-bn" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand", + "rustc-hex", +]