Skip to content

Commit

Permalink
feat: move state sync read operations in consensus app
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Jan 9, 2025
1 parent 2d60300 commit 134855b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
15 changes: 15 additions & 0 deletions packages/rs-drive-abci/src/abci/app/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use drive::grovedb::Transaction;
use std::fmt::Debug;
use std::sync::RwLock;
use tenderdash_abci::proto::abci as proto;
use dapi_grpc::tonic;

Check warning on line 18 in packages/rs-drive-abci/src/abci/app/consensus.rs

View workflow job for this annotation

GitHub Actions / Rust packages (drive-abci) / Linting

unused import: `dapi_grpc::tonic`

warning: unused import: `dapi_grpc::tonic` --> packages/rs-drive-abci/src/abci/app/consensus.rs:18:5 | 18 | use dapi_grpc::tonic; | ^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default

/// AbciApp is an implementation of ABCI Application, as defined by Tenderdash.
///
Expand Down Expand Up @@ -201,4 +202,18 @@ where
) -> Result<proto::ResponseApplySnapshotChunk, proto::ResponseException> {
handler::apply_snapshot_chunk(self, request).map_err(error_into_exception)
}

fn list_snapshots(
&self,
request: proto::RequestListSnapshots,
) -> Result<proto::ResponseListSnapshots, proto::ResponseException> {
handler::list_snapshots(self, request).map_err(error_into_exception)
}

fn load_snapshot_chunk(
&self,
request: proto::RequestLoadSnapshotChunk,
) -> Result<proto::ResponseLoadSnapshotChunk, proto::ResponseException> {
handler::load_snapshot_chunk(self, request).map_err(error_into_exception)
}
}
5 changes: 0 additions & 5 deletions packages/rs-drive-abci/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ pub fn start(
tenderdash_abci::proto::abci::abci_application_server::AbciApplicationServer::new(
check_tx_service,
),
)
.add_service(
tenderdash_abci::proto::abci::abci_application_server::AbciApplicationServer::new(
state_source_service,
),
);

let grpc_server_cancel = cancel.clone();
Expand Down

0 comments on commit 134855b

Please sign in to comment.