Skip to content

Commit

Permalink
pindexer: remove unused event dependency in governance
Browse files Browse the repository at this point in the history
The governance indexer doesn't use the BlockRoot event, and so this
change avoids triggering and running the indexer on that event, which
wastes a noticeable amount of time.
  • Loading branch information
cronokirby committed Sep 13, 2024
1 parent 3beea92 commit a80b219
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions crates/bin/pindexer/src/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use penumbra_governance::{
};
use penumbra_num::Amount;
use penumbra_proto::{
core::component::{
governance::v1::{self as pb},
sct::v1 as sct_pb,
},
core::component::governance::v1::{self as pb},
event::ProtoEvent,
};
use penumbra_stake::IdentityKey;
Expand All @@ -27,7 +24,6 @@ const EVENT_PROPOSAL_FAILED: &str = "penumbra.core.component.governance.v1.Event
const EVENT_PROPOSAL_SLASHED: &str = "penumbra.core.component.governance.v1.EventProposalSlashed";
const EVENT_PROPOSAL_DEPOSIT_CLAIM: &str =
"penumbra.core.component.governance.v1.EventProposalDepositClaim";
const EVENT_BLOCK_ROOT: &str = "penumbra.core.component.sct.v1.EventBlockRoot";
const ALL_RELEVANT_EVENTS: &[&str] = &[
EVENT_PROPOSAL_SUBMIT,
EVENT_DELEGATOR_VOTE,
Expand All @@ -37,7 +33,6 @@ const ALL_RELEVANT_EVENTS: &[&str] = &[
EVENT_PROPOSAL_FAILED,
EVENT_PROPOSAL_SLASHED,
EVENT_PROPOSAL_DEPOSIT_CLAIM,
EVENT_BLOCK_ROOT,
];

#[async_trait]
Expand Down Expand Up @@ -328,10 +323,6 @@ impl AppView for GovernanceProposals {
.context("error converting deposit claim")?;
handle_proposal_deposit_claim(dbtx, deposit_claim).await?;
}
EVENT_BLOCK_ROOT => {
let pe = sct_pb::EventBlockRoot::from_event(event.as_ref())?;
handle_block_root(dbtx, pe.height).await?;
}
_ => {}
}

Expand Down Expand Up @@ -544,7 +535,3 @@ async fn handle_proposal_deposit_claim(

Ok(())
}

async fn handle_block_root(_dbtx: &mut PgTransaction<'_>, _height: u64) -> Result<()> {
Ok(())
}

0 comments on commit a80b219

Please sign in to comment.