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

format code #3

Merged
merged 1 commit into from
Jan 19, 2024
Merged
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
2 changes: 1 addition & 1 deletion node/log_entry_sync/src/sync_manager/log_entry_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::sync_manager::log_query::LogQuery;
use crate::sync_manager::{repeat_run_and_log, RETRY_WAIT_MS};
use anyhow::{anyhow, bail, Result};
use append_merkle::{Algorithm, Sha3Algorithm};
use contract_interface::{ZgsFlow, SubmissionNode, SubmitFilter};
use contract_interface::{SubmissionNode, SubmitFilter, ZgsFlow};
use ethers::abi::RawLog;
use ethers::prelude::{BlockNumber, EthLogDecode, Http, Log, Middleware, Provider, U256};
use ethers::providers::{FilterKind, HttpRateLimitRetryPolicy, RetryClient, RetryClientBuilder};
Expand Down
2 changes: 1 addition & 1 deletion node/miner/src/pora.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use crate::{CustomMineRange, PoraLoader};
use blake2::{Blake2b512, Digest};
use contract_interface::zgs_flow::MineContext;
use ethereum_types::{H256, U256};
use zgs_spec::{BYTES_PER_SCRATCHPAD, BYTES_PER_SEAL, SECTORS_PER_LOAD, SECTORS_PER_SEAL};
use storage::log_store::MineLoadChunk;
use tiny_keccak::{Hasher, Keccak};
use zgs_spec::{BYTES_PER_SCRATCHPAD, BYTES_PER_SEAL, SECTORS_PER_LOAD, SECTORS_PER_SEAL};

pub const BLAKE2B_OUTPUT_BYTES: usize = 64;
pub const KECCAK256_OUTPUT_BYTES: usize = 32;
Expand Down
2 changes: 1 addition & 1 deletion node/miner/src/sealer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ use tokio::{
};

use contract_interface::{EpochRangeWithContextDigest, ZgsFlow};
use zgs_spec::SECTORS_PER_SEAL;
use storage::{
error::Result,
log_store::{SealAnswer, SealTask, Store},
};
use task_executor::TaskExecutor;
use zgs_spec::SECTORS_PER_SEAL;

use crate::config::{MineServiceMiddleware, MinerConfig};

Expand Down
2 changes: 1 addition & 1 deletion node/miner/src/submitter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use contract_interface::PoraAnswer;
use contract_interface::{ZgsFlow, PoraMine};
use contract_interface::{PoraMine, ZgsFlow};
use ethers::providers::PendingTransaction;
use shared_types::FlowRangeProof;
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion node/miner/src/watcher.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(unused)]

use contract_interface::{zgs_flow::MineContext, ZgsFlow, PoraMine};
use contract_interface::{zgs_flow::MineContext, PoraMine, ZgsFlow};
use ethereum_types::{Address, H256, U256};
use ethers::{
contract::Contract,
Expand Down
4 changes: 2 additions & 2 deletions node/network/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ pub(crate) use protocol::{InboundRequest, RPCProtocol};

pub use handler::SubstreamId;
pub use methods::{
DataByHashRequest, GetChunksRequest, GoodbyeReason, MaxRequestBlocks, ZgsData,
RPCResponseErrorCode, ResponseTermination, StatusMessage, MAX_REQUEST_BLOCKS,
DataByHashRequest, GetChunksRequest, GoodbyeReason, MaxRequestBlocks, RPCResponseErrorCode,
ResponseTermination, StatusMessage, ZgsData, MAX_REQUEST_BLOCKS,
};
pub(crate) use outbound::OutboundRequest;
pub use protocol::{max_rpc_size, Protocol, RPCError};
Expand Down
6 changes: 3 additions & 3 deletions node/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ mod admin;
mod config;
mod error;
mod miner;
mod zgs;
mod types;
mod zgs;

use crate::miner::RpcServer as MinerRpcServer;
use admin::RpcServer as AdminRpcServer;
Expand All @@ -18,15 +18,15 @@ use jsonrpsee::core::RpcResult;
use jsonrpsee::http_server::{HttpServerBuilder, HttpServerHandle};
use network::NetworkGlobals;
use network::NetworkMessage;
use zgs::RpcServer as ZgsRpcServer;
use zgs_miner::MinerMessage;
use std::error::Error;
use std::sync::Arc;
use storage_async::Store;
use sync::{SyncRequest, SyncResponse, SyncSender};
use task_executor::ShutdownReason;
use tokio::sync::broadcast;
use tokio::sync::mpsc::UnboundedSender;
use zgs::RpcServer as ZgsRpcServer;
use zgs_miner::MinerMessage;

pub use config::Config as RPCConfig;

Expand Down
2 changes: 1 addition & 1 deletion node/storage/src/log_store/flow_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::{try_option, ZgsKeyValueDB};
use anyhow::{anyhow, bail, Result};
use append_merkle::{MerkleTreeInitialData, MerkleTreeRead};
use itertools::Itertools;
use zgs_spec::{BYTES_PER_SECTOR, SEALS_PER_LOAD, SECTORS_PER_LOAD, SECTORS_PER_SEAL};
use shared_types::{ChunkArray, DataRoot, FlowProof};
use ssz::{Decode, Encode};
use ssz_derive::{Decode as DeriveDecode, Encode as DeriveEncode};
Expand All @@ -17,6 +16,7 @@ use std::fmt::Debug;
use std::sync::Arc;
use std::{cmp, mem};
use tracing::{debug, error, trace};
use zgs_spec::{BYTES_PER_SECTOR, SEALS_PER_LOAD, SECTORS_PER_LOAD, SECTORS_PER_SEAL};

pub struct FlowStore {
db: FlowDBStore,
Expand Down
4 changes: 2 additions & 2 deletions node/storage/src/log_store/load_chunk/chunk_data.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use anyhow::{bail, Result};
use zgs_spec::{BYTES_PER_LOAD, BYTES_PER_SECTOR, SECTORS_PER_LOAD, SECTORS_PER_SEAL};
use shared_types::{bytes_to_chunks, DataRoot};
use ssz_derive::{Decode, Encode};
use std::fmt::{Debug, Formatter};
use std::mem;
use tracing::error;
use zgs_spec::{BYTES_PER_LOAD, BYTES_PER_SECTOR, SECTORS_PER_LOAD, SECTORS_PER_SEAL};

pub enum EntryBatchData {
Complete(Vec<u8>),
Expand Down Expand Up @@ -377,8 +377,8 @@ mod tests {
use crate::log_store::load_chunk::chunk_data::PartialBatch;

use super::EntryBatchData;
use zgs_spec::{BYTES_PER_LOAD, BYTES_PER_SECTOR, SECTORS_PER_LOAD};
use rand::{rngs::StdRng, RngCore, SeedableRng};
use zgs_spec::{BYTES_PER_LOAD, BYTES_PER_SECTOR, SECTORS_PER_LOAD};

fn test_data() -> Vec<u8> {
let mut data = vec![0u8; BYTES_PER_LOAD];
Expand Down
4 changes: 2 additions & 2 deletions node/storage/src/log_store/load_chunk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ use ssz_derive::{Decode, Encode};
use crate::log_store::log_manager::data_to_merkle_leaves;
use crate::try_option;
use append_merkle::{Algorithm, MerkleTreeRead, Sha3Algorithm};
use shared_types::{ChunkArray, DataRoot, Merkle};
use tracing::trace;
use zgs_spec::{
BYTES_PER_LOAD, BYTES_PER_SEAL, BYTES_PER_SECTOR, SEALS_PER_LOAD, SECTORS_PER_LOAD,
SECTORS_PER_SEAL,
};
use shared_types::{ChunkArray, DataRoot, Merkle};
use tracing::trace;

use super::SealAnswer;
use chunk_data::EntryBatchData;
Expand Down
2 changes: 1 addition & 1 deletion node/storage/src/log_store/load_chunk/seal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ impl SealInfo {
mod tests {
use ethereum_types::H256;
use hex_literal::hex;
use rand::{rngs::StdRng, RngCore, SeedableRng};
use zgs_seal;
use zgs_spec::BYTES_PER_SEAL;
use rand::{rngs::StdRng, RngCore, SeedableRng};

use super::{SealContextInfo, SealInfo};

Expand Down
2 changes: 1 addition & 1 deletion node/storage/src/log_store/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use append_merkle::MerkleTreeInitialData;
use ethereum_types::H256;
use zgs_spec::{BYTES_PER_SEAL, SEALS_PER_LOAD};
use shared_types::{
Chunk, ChunkArray, ChunkArrayWithProof, ChunkWithProof, DataRoot, FlowRangeProof, Transaction,
};
use zgs_spec::{BYTES_PER_SEAL, SEALS_PER_LOAD};

use crate::error::Result;

Expand Down
Loading