Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JIT-1661] Faster Autosnapshot #406

Merged
merged 1 commit into from
Nov 8, 2023
Merged

[JIT-1661] Faster Autosnapshot #406

merged 1 commit into from
Nov 8, 2023

Conversation

esemeniuc
Copy link
Contributor

@esemeniuc esemeniuc commented Oct 10, 2023

Notes:

  • Fetches accounts in batches of 100
  • Retry fetching accounts
  • Avoid panic when, forcing account refetch
  • Avoid memory bloat with new blockhashes creating duplicate signatures
  • Log datapoints
  • Balance check delayed (avoid 2x balance requirement)

@buffalu buffalu force-pushed the v1.16 branch 2 times, most recently from 75652a8 to f6b2cc8 Compare October 11, 2023 21:20
tip-distributor/Cargo.toml Outdated Show resolved Hide resolved
tip-distributor/src/bin/claim-mev-tips.rs Show resolved Hide resolved
args.merkle_trees_path.to_string_lossy(),
String
),
("latency_us", start.elapsed().as_micros(), i64),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: elapsed_us

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zano usually suggests latency_us, hence been using that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latency seems like wrong word here, but just a nit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've evolved from using latency for non-networking related measurements, that version of me is no longer present :)

args.merkle_trees_path.to_string_lossy(),
String
),
("latency_us", start.elapsed().as_micros(), i64),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: elapsed_us

.expect("fetch latest blockhash"),
));
let mut rng = rand::thread_rng();
transactions.shuffle(&mut rng); // shuffle to avoid sending same txns as other claim-tip processes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment somewhat misleading, will still send the same? and have potential for failed txs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shuffle is mainly if we run both warehouse nodes, would make them less likely to race for the same txns.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still has potential for failed txns, but we refetch all accounts to see if they're claimed every couple mins to avoid duplicate work.

mut txn: Transaction,
) -> (Transaction, solana_rpc_client_api::client_error::Result<()>) {
txn.sign(&[signer], blockhash); // just in time signing
let res = match rpc_client.send_and_confirm_transaction(&txn).await {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how long does this wait to confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like max amount of time would be blockhash expiry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea looks like that

tip-distributor/src/lib.rs Outdated Show resolved Hide resolved
tip-distributor/src/lib.rs Outdated Show resolved Hide resolved
tip-distributor/src/lib.rs Outdated Show resolved Hide resolved
pub async fn sign_and_send_transactions_with_retries_multi_rpc(
signer: &Arc<Keypair>,
blockhash_rpc_client: &Arc<RpcClient>,
rpc_clients: &Arc<Vec<Arc<RpcClient>>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should make sure we used confirmed or finalized here. finalized will make it much slow though

if we used processed, might end up false confirming a block that gets forked out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mut txn: Transaction,
) -> (Transaction, solana_rpc_client_api::client_error::Result<()>) {
txn.sign(&[signer], blockhash); // just in time signing
let res = match rpc_client.send_and_confirm_transaction(&txn).await {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like max amount of time would be blockhash expiry?

@buffalu buffalu force-pushed the v1.16 branch 2 times, most recently from 4696aa6 to 70c3f57 Compare October 27, 2023 17:19
@esemeniuc esemeniuc changed the title Faster Autosnapshot [JIT-1661] Faster Autosnapshot Nov 8, 2023
@esemeniuc esemeniuc merged commit 2a8d046 into v1.16 Nov 8, 2023
@esemeniuc esemeniuc deleted the eric/tip-dist branch November 8, 2023 11:23
@esemeniuc esemeniuc restored the eric/tip-dist branch November 8, 2023 11:24
@esemeniuc esemeniuc deleted the eric/tip-dist branch November 8, 2023 11:24
@@ -46,7 +51,3 @@ path = "src/bin/merkle-root-uploader.rs"
[[bin]]
name = "solana-claim-mev-tips"
path = "src/bin/claim-mev-tips.rs"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merged into same binary

@esemeniuc esemeniuc mentioned this pull request Nov 8, 2023
buffalu added a commit that referenced this pull request Nov 14, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)
buffalu added a commit that referenced this pull request Nov 14, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)
buffalu added a commit that referenced this pull request Nov 15, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)
buffalu added a commit that referenced this pull request Dec 4, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)
buffalu added a commit that referenced this pull request Dec 5, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)
buffalu added a commit that referenced this pull request Dec 5, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)
buffalu added a commit that referenced this pull request Dec 11, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)
buffalu added a commit that referenced this pull request Dec 12, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)
buffalu added a commit that referenced this pull request Dec 16, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)

[JIT-1713] Fix bundle's blockspace preallocation (Backport to 1.16) (#498)

Backport #500 to v1.16 (#506)
buffalu added a commit that referenced this pull request Dec 16, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)

[JIT-1713] Fix bundle's blockspace preallocation (Backport to 1.16) (#498)

Backport #500 to v1.16 (#506)
buffalu added a commit that referenced this pull request Dec 18, 2023
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)

[JIT-1713] Fix bundle's blockspace preallocation (Backport to 1.16) (#498)

Backport #500 to v1.16 (#506)
buffalu added a commit that referenced this pull request Jan 5, 2024
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)

[JIT-1713] Fix bundle's blockspace preallocation (Backport to 1.16) (#498)

Backport #500 to v1.16 (#506)

backports #520: add priority fees to mev claim (#524)

Backport #548 (#549)
buffalu added a commit that referenced this pull request Jan 5, 2024
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)

[JIT-1713] Fix bundle's blockspace preallocation (Backport to 1.16) (#498)

Backport #500 to v1.16 (#506)

backports #520: add priority fees to mev claim (#524)

Backport #548 (#549)
buffalu added a commit that referenced this pull request Jan 6, 2024
Use cluster info functions for tpu (#345) (#347)
Use git rev-parse for git sha
Remove blacklisted tx from message_hash_to_transaction (Backport #374) (#376)
Updates scripts for easy local setup. (#383)
Backports sim_bundle improvements (#407)
backports clone derivation 416 (#417)
Backport #419: add upsert to AccountOverrides (#420)

backports #430 v1.16: update jito-programs sha (#431)

[JIT-1661] Faster Autosnapshot (#406)

Fix Buildkite warnings (#437)

Backport #446 to v1.16 (#447)

backport 428, runtime plugin (#429)

v1.16: Backport #449 (#450)

[JIT-1713] Fix bundle's blockspace preallocation (Backport to 1.16) (#498)

Backport #500 to v1.16 (#506)

backports #520: add priority fees to mev claim (#524)

Backport #548 (#549)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants