Skip to content

Commit

Permalink
Fix accumulated bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Nov 6, 2023
1 parent c900387 commit b65ba17
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 140 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 1 addition & 14 deletions coins/ethereum/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,7 @@ pub enum EthereumError {
VerificationError,
}

abigen!(Schnorr, "./artifacts/Schnorr.sol/Schnorr.json",);

pub async fn deploy_schnorr_verifier_contract(
client: Arc<SignerMiddleware<Provider<Http>, LocalWallet>>,
) -> Result<Schnorr<SignerMiddleware<Provider<Http>, LocalWallet>>> {
let path = "./artifacts/Schnorr.sol/Schnorr.json";
let artifact: ContractBytecode = serde_json::from_reader(File::open(path).unwrap()).unwrap();
let abi = artifact.abi.unwrap();
let bin = artifact.bytecode.unwrap().object;
let factory = ContractFactory::new(abi, bin.into_bytes().unwrap(), client.clone());
let contract = factory.deploy(())?.send().await?;
let contract = Schnorr::new(contract.address(), client);
Ok(contract)
}
abigen!(Schnorr, "./artifacts/Schnorr.sol/Schnorr.json");

pub async fn call_verify(
contract: &Schnorr<SignerMiddleware<Provider<Http>, LocalWallet>>,
Expand Down
6 changes: 3 additions & 3 deletions orchestration/coordinator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM rust:1.73-slim-bookworm as builder
LABEL description="STAGE 1: Build"

# Upgrade and add dev dependencies
RUN apt update && apt upgrade -y && apt install -y pkg-config clang libssl-dev && apt autoremove -y && apt clean
RUN apt update && apt upgrade -y && apt install -y pkg-config clang && apt autoremove -y && apt clean

# Add the wasm toolchain
RUN rustup target add wasm32-unknown-unknown
Expand Down Expand Up @@ -51,8 +51,8 @@ FROM debian:bookworm-slim as image
COPY --from=mimalloc libmimalloc.so /usr/lib
RUN echo "/usr/lib/libmimalloc.so" >> /etc/ld.so.preload

# Upgrade packages and install openssl
RUN apt update && apt upgrade -y && apt install -y libssl-dev && apt autoremove && apt clean
# Upgrade packages and install ca-certificates
RUN apt update && apt upgrade -y && apt install -y ca-certificates && apt autoremove && apt clean

# Switch to a non-root user
RUN useradd --system --create-home --shell /sbin/nologin coordinator
Expand Down
6 changes: 3 additions & 3 deletions orchestration/processor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM rust:1.73-slim-bookworm as builder
LABEL description="STAGE 1: Build"

# Upgrade and add dev dependencies
RUN apt update && apt upgrade -y && apt install -y pkg-config clang libssl-dev && apt autoremove -y && apt clean
RUN apt update && apt upgrade -y && apt install -y pkg-config clang && apt autoremove -y && apt clean

# Add files for build
ADD common /serai/common
Expand Down Expand Up @@ -51,8 +51,8 @@ FROM debian:bookworm-slim as image
COPY --from=mimalloc libmimalloc.so /usr/lib
RUN echo "/usr/lib/libmimalloc.so" >> /etc/ld.so.preload

# Upgrade packages and install openssl
RUN apt update && apt upgrade -y && apt install -y ca-certificates libssl-dev
# Upgrade packages and install ca-certificates
RUN apt update && apt upgrade -y && apt install -y ca-certificates

# Switch to a non-root user
RUN useradd --system --create-home --shell /sbin/nologin processor
Expand Down
3 changes: 0 additions & 3 deletions substrate/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ futures = "0.3"
jsonrpsee = { version = "0.16", features = ["server"] }

sp-core = { git = "https://github.com/serai-dex/substrate" }
sp-keyring = { git = "https://github.com/serai-dex/substrate" }
sp-inherents = { git = "https://github.com/serai-dex/substrate" }
sp-timestamp = { git = "https://github.com/serai-dex/substrate" }
sp-io = { git = "https://github.com/serai-dex/substrate" }
sp-runtime = { git = "https://github.com/serai-dex/substrate" }
sp-blockchain = { git = "https://github.com/serai-dex/substrate" }
sp-api = { git = "https://github.com/serai-dex/substrate" }
sp-block-builder = { git = "https://github.com/serai-dex/substrate" }
Expand Down
24 changes: 3 additions & 21 deletions substrate/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ use serai_runtime::Block;
use sc_service::{PruningMode, PartialComponents};

use sc_cli::SubstrateCli;
use frame_benchmarking_cli::{ExtrinsicFactory, BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};

use crate::{
chain_spec,
cli::{Cli, Subcommand},
command_helper::{RemarkBuilder, inherent_benchmark_data},
service::{self, FullClient},
};

Expand Down Expand Up @@ -110,26 +109,9 @@ pub fn run() -> sc_cli::Result<()> {
cmd.run(config, client, backend.expose_db(), backend.expose_storage())
}

BenchmarkCmd::Overhead(cmd) => {
let client = service::new_partial(&config)?.client;
cmd.run(
config,
client.clone(),
inherent_benchmark_data()?,
vec![],
&RemarkBuilder::new(client),
)
}
BenchmarkCmd::Overhead(_) => Err("Overhead benchmarking isn't supported.".into()),

BenchmarkCmd::Extrinsic(cmd) => {
let client = service::new_partial(&config)?.client;
cmd.run(
client.clone(),
inherent_benchmark_data()?,
vec![],
&ExtrinsicFactory(vec![Box::new(RemarkBuilder::new(client))]),
)
}
BenchmarkCmd::Extrinsic(_) => Err("Extrinsic benchmarking isn't supported.".into()),

BenchmarkCmd::Machine(cmd) => cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()),
}),
Expand Down
92 changes: 0 additions & 92 deletions substrate/node/src/command_helper.rs

This file was deleted.

1 change: 0 additions & 1 deletion substrate/node/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
mod chain_spec;
mod service;

mod command_helper;
mod command;

mod rpc;
Expand Down

0 comments on commit b65ba17

Please sign in to comment.