Skip to content

Commit

Permalink
More profiling + small bugfix (#281)
Browse files Browse the repository at this point in the history
* More profiling + small bugfix
  • Loading branch information
m30m authored Dec 4, 2024
1 parent d36e3c8 commit d0e7b89
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion auction-server/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 auction-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "auction-server"
version = "0.14.0"
version = "0.14.1"
edition = "2021"
license-file = "license.txt"

Expand Down
15 changes: 12 additions & 3 deletions auction-server/src/auction/service/handle_bid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,25 @@ impl<T: ChainTrait> Service<T>
where
Service<T>: Verification<T>,
{
#[tracing::instrument(skip_all, fields(bid_id))]
#[tracing::instrument(skip_all, fields(bid_id, profile_name, simulation_error))]
pub async fn handle_bid(
&self,
input: HandleBidInput<T>,
) -> Result<entities::Bid<T>, RestError> {
let (chain_data, amount) = self
if let Some(profile) = &input.bid_create.profile {
tracing::Span::current().record("profile_name", &profile.name);
}
let verification = self
.verify_bid(VerifyBidInput {
bid_create: input.bid_create.clone(),
})
.await?;
.await;
if let Err(RestError::SimulationError { result: _, reason }) = &verification {
// Long values are truncated and the errors are at the end of the simulation logs
let error = reason.split('\n').rev().collect::<Vec<_>>().join("\n");
tracing::Span::current().record("simulation_error", error);
}
let (chain_data, amount) = verification?;
let bid = self
.repo
.add_bid(input.bid_create, &chain_data, &amount)
Expand Down
3 changes: 2 additions & 1 deletion auction-server/src/auction/service/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl Simulator {
/// Fetches all the accounts needed for simulating the transactions via RPC
/// Uses the account cache to avoid fetching programs and lookup tables multiple times
/// Returns an AccountsConfig struct that can be used to initialize the LiteSVM instance
#[tracing::instrument(skip_all)]
#[tracing::instrument(skip_all, fields(slot))]
async fn fetch_tx_accounts_via_rpc(
&self,
transactions: &[VersionedTransaction],
Expand All @@ -261,6 +261,7 @@ impl Simulator {
let keys = keys.into_iter().collect::<Vec<_>>();

let accounts_with_context = self.get_multiple_accounts_chunked(&keys).await?;
tracing::Span::current().record("slot", accounts_with_context.context.slot);
let accounts = accounts_with_context.value;
let mut accounts_config = AccountsConfig::new();
let mut programs_to_fetch = vec![];
Expand Down
2 changes: 1 addition & 1 deletion sdk/js/src/examples/testingSearcherPing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SearcherPinger extends SimpleSearcherLimo {
this.searcher.publicKey,
this.searcher.publicKey,
this.searcher.publicKey,
new anchor.BN(0),
this.bid,
new anchor.BN(Math.round(Date.now() / 1000 + 60)),
this.chainId,
config.relayerSigner,
Expand Down

0 comments on commit d0e7b89

Please sign in to comment.