Skip to content

Commit

Permalink
Fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiencs committed May 9, 2024
1 parent 4bca9b5 commit df6cb14
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 57 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ crc32fast = "1"
chrono = "0.4"
serde_with = "3.6.1"
anyhow = "1.0.75"
fraction = { version = "0.15", default-features = false, features = ["with-serde-support"] }
fraction = { version = "=0.15.1", default-features = false, features = ["with-serde-support"] }

[target.'cfg(target_family = "wasm")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/scan_state/transaction_logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ pub mod zkapp_command {
use std::sync::Arc;

use ark_ff::UniformRand;
use mina_p2p_messages::v2::{self, MinaBaseZkappCommandTStableV1WireStableV1AccountUpdatesA};
use mina_p2p_messages::v2::MinaBaseZkappCommandTStableV1WireStableV1AccountUpdatesA;
use mina_signer::Signature;
use rand::{seq::SliceRandom, Rng};

Expand Down
29 changes: 13 additions & 16 deletions node/native/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ use std::collections::{BTreeMap, VecDeque};
use std::sync::{Arc, Mutex};

use ledger::scan_state::scan_state::transaction_snark::{SokDigest, Statement};
use ledger::scan_state::transaction_logic::{verifiable, UserCommand, WithStatus};
use ledger::scan_state::transaction_logic::{verifiable, WithStatus};
use ledger::verifier::Verifier;
use libp2p::identity::Keypair;
use libp2p_identity::Keypair;
use mina_p2p_messages::v2::{
LedgerHash, LedgerProofProdStableV2, MinaBaseAccountBinableArgStableV2,
MinaBaseSparseLedgerBaseStableV2, MinaLedgerSyncLedgerAnswerStableV2,
MinaLedgerSyncLedgerQueryStableV1, MinaStateProtocolStateValueStableV2, NonZeroCurvePoint,
StateHash, TransactionSnarkWorkTStableV2Proofs,
LedgerHash, LedgerProofProdStableV2, TransactionSnarkWorkTStableV2Proofs,
};
use node::p2p::service_impl::mio::MioService;
use node::p2p::service_impl::services::NativeP2pNetworkService;
use node::snark::user_command_verify::{SnarkUserCommandVerifyId, SnarkUserCommandVerifyService};
use node::transaction_pool::{TransactionPoolLedgerService, VerifyUserCommandsService};
use openmina_core::block::ArcBlockWithHash;
use node::transaction_pool::TransactionPoolLedgerService;
use rand::prelude::*;
use redux::ActionMeta;
use serde::Serialize;
Expand Down Expand Up @@ -235,14 +232,14 @@ impl SnarkBlockVerifyService for NodeService {
}
}

impl TransactionPoolLedgerService for NodeService {
fn get_mask(&self, ledger_hash: &LedgerHash) -> Result<ledger::Mask, String> {
self.ledger_manager
.get_mask(&ledger_hash)
.map(|(mask, _)| mask)
.ok_or_else(|| "Mask not found".to_string())
}
}
// impl TransactionPoolLedgerService for NodeService {
// fn get_mask(&self, ledger_hash: &LedgerHash) -> Result<ledger::Mask, String> {
// self.ledger_manager
// .get_mask(&ledger_hash)
// .map(|(mask, _)| mask)
// .ok_or_else(|| "Mask not found".to_string())
// }
// }

impl SnarkUserCommandVerifyService for NodeService {
fn verify_init(
Expand Down
2 changes: 1 addition & 1 deletion node/src/action_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ pub enum ActionKind {
}

impl ActionKind {
pub const COUNT: u16 = 363;
pub const COUNT: u16 = 370;
}

impl std::fmt::Display for ActionKind {
Expand Down
3 changes: 0 additions & 3 deletions node/src/event_source/event_source_effects.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use p2p::channels::snark::P2pChannelsSnarkAction;
use p2p::listen::P2pListenAction;
use p2p::P2pListenEvent;
use snark::user_command_verify::{SnarkUserCommandVerifyAction, SnarkUserCommandVerifyError};

use crate::action::CheckTimeoutsAction;
Expand All @@ -11,7 +9,6 @@ use crate::ledger::read::LedgerReadAction;
use crate::ledger::write::LedgerWriteAction;
use crate::p2p::channels::best_tip::P2pChannelsBestTipAction;
use crate::p2p::channels::rpc::P2pChannelsRpcAction;
use crate::p2p::channels::snark::P2pChannelsSnarkAction;
use crate::p2p::channels::snark_job_commitment::P2pChannelsSnarkJobCommitmentAction;
use crate::p2p::channels::{ChannelId, P2pChannelsMessageReceivedAction};
use crate::p2p::connection::incoming::P2pConnectionIncomingAction;
Expand Down
20 changes: 6 additions & 14 deletions node/src/ledger/ledger_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,8 @@ use super::write::{LedgerWriteRequest, LedgerWriteResponse};
use super::LedgerService;
use crate::account::AccountPublicKey;
use crate::ledger::LedgerAddress;
use crate::p2p::channels::rpc::StagedLedgerAuxAndPendingCoinbases;
use crate::rpc::{RpcLedgerService, RpcScanStateSummaryScanStateJob};
use crate::transaction_pool::TransactionPoolLedgerService;
use crate::transition_frontier::sync::{
ledger::snarked::TransitionFrontierSyncLedgerSnarkedService,
ledger::staged::{
StagedLedgerAuxAndPendingCoinbasesValid, TransitionFrontierSyncLedgerStagedService,
},
TransitionFrontierRootSnarkedLedgerUpdates,
};
use crate::transition_frontier::{CommitResult, TransitionFrontierService};
use crate::transition_frontier::sync::ledger::snarked::TransitionFrontierSyncLedgerSnarkedService;
use ledger::Mask;
use mina_signer::CompressedPubKey;

Expand Down Expand Up @@ -387,11 +378,12 @@ fn format_response_error(method: &str, res: LedgerResponse) -> String {
format!("LedgerManager::{method}: unexpected response: {res:?}")
}

impl TransactionPoolLedgerService for LedgerManager {
impl<T: LedgerService> TransactionPoolLedgerService for T {
fn get_mask(&self, ledger_hash: &LedgerHash) -> Result<Mask, String> {
self.get_mask(&ledger_hash)
.map(|(mask, _)| mask)
.ok_or_else(|| "Mask not found".to_string())
todo!()
// self.get_mask(&ledger_hash)
// .map(|(mask, _)| mask)
// .ok_or_else(|| "Mask not found".to_string())
}
}

Expand Down
20 changes: 1 addition & 19 deletions node/src/ledger/ledger_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,16 @@ use mina_signer::CompressedPubKey;
use openmina_core::block::ArcBlockWithHash;

use crate::account::AccountPublicKey;
use crate::block_producer::StagedLedgerDiffCreateOutput;
use crate::p2p::channels::rpc::StagedLedgerAuxAndPendingCoinbases;
use crate::rpc::{
RpcScanStateSummaryBlockTransaction, RpcScanStateSummaryScanStateJob,
RpcScanStateSummaryScanStateJobKind, RpcSnarkPoolJobSnarkWorkDone,
use crate::block_producer::vrf_evaluator::DelegatorTable;
use crate::block_producer::{
BlockProducerLedgerService, BlockProducerWonSlot, StagedLedgerDiffCreateOutput,
};
use crate::block_producer::StagedLedgerDiffCreateOutput;
use crate::transition_frontier::sync::{
ledger::staged::StagedLedgerAuxAndPendingCoinbasesValid,
TransitionFrontierRootSnarkedLedgerUpdates,
};
use crate::transition_frontier::TransitionFrontierService;
use crate::{
block_producer::vrf_evaluator::BlockProducerVrfEvaluatorLedgerService,
transaction_pool::TransactionPoolLedgerService,
};
use crate::{
p2p::channels::rpc::StagedLedgerAuxAndPendingCoinbases, transition_frontier::CommitResult,
};
use crate::{
rpc::{
RpcLedgerService, RpcScanStateSummaryBlockTransaction, RpcScanStateSummaryScanStateJob,
RpcScanStateSummaryScanStateJobKind, RpcSnarkPoolJobSnarkWorkDone,
},
transition_frontier::sync::ledger::snarked::TransitionFrontierSyncLedgerSnarkedService,
};

use super::write::CommitResult;

Expand Down

0 comments on commit df6cb14

Please sign in to comment.