Skip to content

Commit

Permalink
Rework bundle receiving and add metrics (#152) (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalu committed Oct 6, 2022
1 parent a10ddce commit 49231ca
Show file tree
Hide file tree
Showing 16 changed files with 1,439 additions and 413 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ log-*/
.DS_Store
# scripts that may be generated by cargo *-bpf commands
**/cargo-*-bpf-child-script-*.sh

docker-output/
76 changes: 38 additions & 38 deletions Cargo.lock

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

9 changes: 4 additions & 5 deletions bootstrap
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env sh
bank_hash=$(./target/release/solana-ledger-tool -l config/bootstrap-validator bank-hash)

# NOTE: each developer will need to adjust the tip-payment-program-pubkey and tip-distribution-program-pubkey AND
# their respective declare_id!() fields in each anchor program based on the private key used to deploy the program on your cluster.
RUST_LOG=INFO \
# NOTE: make sure tip-payment and tip-distribution program are deployed using the correct pubkeys
RUST_LOG=INFO,solana_core::bundle_stage=DEBUG \
NDEBUG=1 ./multinode-demo/bootstrap-validator.sh \
--wait-for-supermajority 0 \
--expected-bank-hash $bank_hash \
Expand All @@ -13,8 +12,8 @@ RUST_LOG=INFO \
--relayer-address http://127.0.0.1:11226 \
--rpc-pubsub-enable-block-subscription \
--enable-rpc-transaction-history \
--tip-payment-program-pubkey DThZmRNNXh7kvTQW9hXeGoWGPKktK8pgVAyoTLjH7UrT \
--tip-distribution-program-pubkey FjrdANjvo76aCYQ4kf9FM1R8aESUcEE6F8V7qyoVUQcM \
--tip-payment-program-pubkey 6veFRUKJBNGMR58LEcKn5Bc6MR17WZF4rsgD4Lqq7fsU \
--tip-distribution-program-pubkey 3PX9z1qPj37eNZqH7e5fyaVDyG7ARqkjkYEe1a4xsBkA \
--commission-bps 0 \
--shred-receiver-address 127.0.0.1:1002 \
--allow-private-addr \
Expand Down
9 changes: 8 additions & 1 deletion core/src/bundle_account_locker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ mod tests {
},
solana_ledger::genesis_utils::create_genesis_config,
solana_perf::packet::PacketBatch,
solana_runtime::{bank::Bank, genesis_utils::GenesisConfigInfo},
solana_runtime::{
bank::Bank, genesis_utils::GenesisConfigInfo,
transaction_error_metrics::TransactionErrorMetrics,
},
solana_sdk::{
packet::Packet, signature::Signer, signer::keypair::Keypair, system_program,
system_transaction::transfer, transaction::VersionedTransaction,
Expand Down Expand Up @@ -270,18 +273,22 @@ mod tests {
uuid: Uuid::new_v4(),
};

let mut transaction_errors = TransactionErrorMetrics::default();

let sanitized_bundle0 = get_sanitized_bundle(
&packet_bundle0,
&bank,
&HashSet::default(),
&HashSet::default(),
&mut transaction_errors,
)
.expect("sanitize bundle 0");
let sanitized_bundle1 = get_sanitized_bundle(
&packet_bundle1,
&bank,
&HashSet::default(),
&HashSet::default(),
&mut transaction_errors,
)
.expect("sanitize bundle 1");

Expand Down
Loading

0 comments on commit 49231ca

Please sign in to comment.