Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Feb 16, 2024
1 parent ced19df commit 2d4d95f
Show file tree
Hide file tree
Showing 90 changed files with 6,806 additions and 7,443 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

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

11 changes: 6 additions & 5 deletions crates/apps/src/lib/node/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ use namada::core::storage::Key;
use namada::core::time::DateTimeUtc;
use namada::eth_bridge::ethers::providers::{Http, Provider};
use namada::governance::storage::keys as governance_storage;
use namada_sdk::tendermint::abci::request::CheckTxKind;
use namada::state::State;
use namada::tendermint::abci::request::CheckTxKind;
use namada_sdk::state::StateRead;
use once_cell::unsync::Lazy;
use sysinfo::{RefreshKind, System, SystemExt};
use tokio::sync::mpsc;
Expand Down Expand Up @@ -66,16 +68,15 @@ const ENV_VAR_RAYON_THREADS: &str = "NAMADA_RAYON_THREADS";
impl Shell {
fn load_proposals(&mut self) {
let proposals_key = governance_storage::get_commiting_proposals_prefix(
self.wl_storage.storage.last_epoch.0,
self.state.in_mem().last_epoch.0,
);

let (proposal_iter, _) =
self.wl_storage.storage.iter_prefix(&proposals_key);
let (proposal_iter, _) = self.state.db_iter_prefix(&proposals_key);
for (key, _, _) in proposal_iter {
let key =
Key::from_str(key.as_str()).expect("Key should be parsable");
if governance_storage::get_commit_proposal_epoch(&key).unwrap()
!= self.wl_storage.storage.last_epoch.0
!= self.state.in_mem().last_epoch.0
{
// NOTE: `iter_prefix` iterate over the matching prefix. In this
// case a proposal with grace_epoch 110 will be
Expand Down
6 changes: 3 additions & 3 deletions crates/apps/src/lib/node/ledger/shell/block_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub mod states;
use std::marker::PhantomData;

use namada::proof_of_stake::pos_queries::PosQueries;
use namada::state::{self, WlStorage};
use namada::state::{self, WlState};

#[allow(unused_imports)]
use crate::facade::tendermint_proto::abci::RequestPrepareProposal;
Expand Down Expand Up @@ -141,14 +141,14 @@ pub struct BlockAllocator<State> {
decrypted_txs: TxBin<BlockSpace>,
}

impl<D, H, M> From<&WlStorage<D, H>>
impl<D, H, M> From<&WlState<D, H>>
for BlockAllocator<states::BuildingEncryptedTxBatch<M>>
where
D: 'static + state::DB + for<'iter> state::DBIter<'iter>,
H: 'static + state::StorageHasher,
{
#[inline]
fn from(storage: &WlStorage<D, H>) -> Self {
fn from(storage: &WlState<D, H>) -> Self {
Self::init(
storage.pos_queries().get_max_proposal_bytes().get(),
namada::parameters::get_max_block_gas(storage).unwrap(),
Expand Down
Loading

0 comments on commit 2d4d95f

Please sign in to comment.