From a578fd5c586effb348e75bf98d086606127c0db0 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Thu, 4 Apr 2024 21:02:05 -0400 Subject: [PATCH 01/11] Expose traits needed for steward testing --- keepers/validator-keeper/src/cluster_info.rs | 6 +++--- programs/validator-history/src/state.rs | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/keepers/validator-keeper/src/cluster_info.rs b/keepers/validator-keeper/src/cluster_info.rs index a6dd892a..3d0ebee5 100644 --- a/keepers/validator-keeper/src/cluster_info.rs +++ b/keepers/validator-keeper/src/cluster_info.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use anchor_lang::{InstructionData, ToAccountMetas}; -use keeper_core::{submit_instructions, SubmitStats, TransactionExecutionError}; +use keeper_core::{submit_transactions, SubmitStats, TransactionExecutionError}; use solana_client::nonblocking::rpc_client::RpcClient; use solana_sdk::{ compute_budget, instruction::Instruction, pubkey::Pubkey, signature::Keypair, signer::Signer, @@ -30,9 +30,9 @@ pub async fn update_cluster_info( data: validator_history::instruction::CopyClusterInfo {}.data(), }; - submit_instructions( + submit_transactions( &client, - vec![heap_request_ix, compute_budget_ix, update_instruction], + vec![vec![heap_request_ix, compute_budget_ix, update_instruction]], &keypair, ) .await diff --git a/programs/validator-history/src/state.rs b/programs/validator-history/src/state.rs index 184ba815..96eececd 100644 --- a/programs/validator-history/src/state.rs +++ b/programs/validator-history/src/state.rs @@ -643,6 +643,7 @@ impl ValidatorHistory { } } +#[derive(AnchorSerialize)] #[account(zero_copy)] pub struct ClusterHistory { pub struct_version: u64, @@ -653,6 +654,7 @@ pub struct ClusterHistory { pub history: CircBufCluster, } +#[derive(AnchorSerialize)] #[zero_copy] pub struct ClusterHistoryEntry { pub total_blocks: u32, @@ -674,6 +676,7 @@ impl Default for ClusterHistoryEntry { } } +#[derive(AnchorSerialize)] #[zero_copy] pub struct CircBufCluster { pub idx: u64, From e5b2d1ee48a95f89ad899f4112914c82d5c62cb3 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Wed, 24 Apr 2024 22:45:34 -0400 Subject: [PATCH 02/11] Updated everything, WIP declare_program --- Cargo.lock | 1393 +++++++++-------- Cargo.toml | 6 +- idls/jito_tip_distribution.json | 489 ++++++ keepers/keeper-core/Cargo.toml | 8 +- keepers/validator-keeper/Cargo.toml | 21 +- keepers/validator-keeper/src/lib.rs | 52 +- .../validator-keeper/src/mev_commission.rs | 9 +- programs/validator-history/Cargo.toml | 6 +- programs/validator-history/src/constants.rs | 1 + .../src/instructions/initialize_config.rs | 2 +- .../realloc_cluster_history_account.rs | 2 +- .../realloc_validator_history_account.rs | 2 +- programs/validator-history/src/lib.rs | 2 + programs/validator-history/src/utils.rs | 19 +- tests/Cargo.toml | 11 +- tests/src/fixtures.rs | 13 +- utils/validator-history-cli/Cargo.toml | 15 +- utils/vote-state/Cargo.toml | 4 +- 18 files changed, 1319 insertions(+), 736 deletions(-) create mode 100644 idls/jito_tip_distribution.json diff --git a/Cargo.lock b/Cargo.lock index 8c8b09f6..d5baad9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,9 +65,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom 0.2.12", "once_cell", @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom 0.2.12", @@ -119,64 +119,58 @@ dependencies = [ [[package]] name = "anchor-attribute-access-control" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa5be5b72abea167f87c868379ba3c2be356bfca9e6f474fd055fa0f7eeb4f2" +checksum = "dd7368e171b3a317885dc08ec0f74eed9d0ad6c726cc819593aed81440dca926" dependencies = [ "anchor-syn", - "anyhow", "proc-macro2 1.0.78", "quote 1.0.35", - "regex", "syn 1.0.109", ] [[package]] name = "anchor-attribute-account" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f468970344c7c9f9d03b4da854fd7c54f21305059f53789d0045c1dd803f0018" +checksum = "f527df85a8cba3f2bea04e46ed71b66e525ea378c7fec538aa205f4520b73e31" dependencies = [ "anchor-syn", - "anyhow", "bs58 0.5.0", "proc-macro2 1.0.78", "quote 1.0.35", - "rustversion", "syn 1.0.109", ] [[package]] name = "anchor-attribute-constant" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59948e7f9ef8144c2aefb3f32a40c5fce2798baeec765ba038389e82301017ef" +checksum = "3eb1dc1845cf8636c2e046a274ca074dabd3884ac8ed11cc4ed64b7e8ef5a318" dependencies = [ "anchor-syn", - "proc-macro2 1.0.78", + "quote 1.0.35", "syn 1.0.109", ] [[package]] name = "anchor-attribute-error" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc753c9d1c7981cb8948cf7e162fb0f64558999c0413058e2d43df1df5448086" +checksum = "7f382e41514c59a77ffa7bb1a47df9a0359564a749b6934485c742c11962e540" dependencies = [ "anchor-syn", - "proc-macro2 1.0.78", "quote 1.0.35", "syn 1.0.109", ] [[package]] name = "anchor-attribute-event" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38b4e172ba1b52078f53fdc9f11e3dc0668ad27997838a0aad2d148afac8c97" +checksum = "473a122aeed3f6b666438236338d2ef7833ee5fdc5688e1baa80185d61088a53" dependencies = [ "anchor-syn", - "anyhow", "proc-macro2 1.0.78", "quote 1.0.35", "syn 1.0.109", @@ -184,25 +178,40 @@ dependencies = [ [[package]] name = "anchor-attribute-program" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eebd21543606ab61e2d83d9da37d24d3886a49f390f9c43a1964735e8c0f0d5" +checksum = "7f88c7ffe2eb40aeac43ffd0d74a6671581158aedfaa0552330a2ef92fa5c889" dependencies = [ + "anchor-lang-idl", "anchor-syn", "anyhow", + "bs58 0.5.0", + "heck 0.3.3", "proc-macro2 1.0.78", "quote 1.0.35", + "serde_json", "syn 1.0.109", ] [[package]] name = "anchor-derive-accounts" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec4720d899b3686396cced9508f23dab420f1308344456ec78ef76f98fda42af" +checksum = "ed9b97c99dcec135aae0ff908c14bcfcd3e78cfc16a0c6f245135038f0e6d390" dependencies = [ "anchor-syn", - "anyhow", + "quote 1.0.35", + "syn 1.0.109", +] + +[[package]] +name = "anchor-derive-serde" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbece98f6ad9c37070edc0841326c9623a249346cd74f433e7cef69b14f7f31d" +dependencies = [ + "anchor-syn", + "borsh-derive-internal 0.10.3", "proc-macro2 1.0.78", "quote 1.0.35", "syn 1.0.109", @@ -210,9 +219,9 @@ dependencies = [ [[package]] name = "anchor-derive-space" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f495e85480bd96ddeb77b71d499247c7d4e8b501e75ecb234e9ef7ae7bd6552a" +checksum = "8badbe2648bc99a85ee05a7a5f9512e5e2af8ffac71476a69350cb278057ac53" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", @@ -221,9 +230,9 @@ dependencies = [ [[package]] name = "anchor-lang" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2d4b20100f1310a774aba3471ef268e5c4ba4d5c28c0bbe663c2658acbc414" +checksum = "e41feb9c1cd9f4b0fad1c004fc8f289183f3ce27e9db38fa6e434470c716fb1e" dependencies = [ "anchor-attribute-access-control", "anchor-attribute-account", @@ -232,9 +241,11 @@ dependencies = [ "anchor-attribute-event", "anchor-attribute-program", "anchor-derive-accounts", + "anchor-derive-serde", "anchor-derive-space", + "anchor-lang-idl", "arrayref", - "base64 0.13.1", + "base64 0.21.7", "bincode", "borsh 0.10.3", "bytemuck", @@ -243,14 +254,28 @@ dependencies = [ "thiserror", ] +[[package]] +name = "anchor-lang-idl" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b29da81eae478b1bb846749b06b8a2cb9c6f9ed26ca793b0c916793fdf36adab" +dependencies = [ + "anchor-syn", + "anyhow", + "regex", + "serde", + "serde_json", +] + [[package]] name = "anchor-syn" -version = "0.28.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a125e4b0cc046cfec58f5aa25038e34cf440151d58f0db3afc55308251fe936d" +checksum = "ac53f2378bc08e89e20c2b893c01986ffd34cfbc69a17e35bd6f754753e9fdad" dependencies = [ "anyhow", "bs58 0.5.0", + "cargo_toml", "heck 0.3.3", "proc-macro2 1.0.78", "quote 1.0.35", @@ -339,6 +364,20 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +[[package]] +name = "aquamarine" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" +dependencies = [ + "include_dir", + "itertools", + "proc-macro-error", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", +] + [[package]] name = "arc-swap" version = "1.6.0" @@ -462,12 +501,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "array-bytes" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" - [[package]] name = "arrayref" version = "0.3.7" @@ -763,6 +796,9 @@ name = "bitflags" version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +dependencies = [ + "serde", +] [[package]] name = "bitmaps" @@ -832,6 +868,16 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "borsh" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0901fc8eb0aca4c83be0106d6f2db17d86a08dfc2c25f0e84464bf381158add6" +dependencies = [ + "borsh-derive 1.4.0", + "cfg_aliases", +] + [[package]] name = "borsh-derive" version = "0.9.3" @@ -858,6 +904,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "borsh-derive" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51670c3aa053938b0ee3bd67c3817e471e626151131b934038e83c5bf8de48f5" +dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", + "syn_derive", +] + [[package]] name = "borsh-derive-internal" version = "0.9.3" @@ -1017,6 +1077,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "cargo_toml" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a98356df42a2eb1bd8f1793ae4ee4de48e384dd974ce5eac8eee802edb7492be" +dependencies = [ + "serde", + "toml 0.8.12", +] + [[package]] name = "cc" version = "1.0.83" @@ -1042,6 +1112,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chrono" version = "0.4.33" @@ -1393,12 +1469,15 @@ dependencies = [ [[package]] name = "dashmap" -version = "4.0.2" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "num_cpus", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core 0.9.9", "rayon", ] @@ -1408,6 +1487,17 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +[[package]] +name = "default-env" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f753eb82d29277e79efc625e84aecacfd4851ee50e05a8573a4740239a77bfd3" +dependencies = [ + "proc-macro2 0.4.30", + "quote 0.6.13", + "syn 0.15.44", +] + [[package]] name = "der" version = "0.5.1" @@ -1469,6 +1559,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + [[package]] name = "digest" version = "0.9.0" @@ -1510,28 +1606,34 @@ dependencies = [ ] [[package]] -name = "dlopen" -version = "0.1.8" +name = "dlopen2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e80ad39f814a9abe68583cd50a2d45c8a67561c3361ab8da240587dda80937" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" dependencies = [ - "dlopen_derive", - "lazy_static", + "dlopen2_derive", "libc", + "once_cell", "winapi", ] [[package]] -name = "dlopen_derive" -version = "0.1.4" +name = "dlopen2_derive" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f236d9e1b1fbd81cea0f9cbdc8dcc7e8ebcd80e6659cd7cb2ad5f6c05946c581" +checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ - "libc", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", ] +[[package]] +name = "downcast" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" + [[package]] name = "eager" version = "0.1.0" @@ -1573,18 +1675,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "educe" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" -dependencies = [ - "enum-ordinalize", - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 1.0.109", -] - [[package]] name = "either" version = "1.9.0" @@ -1626,19 +1716,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "enum-ordinalize" -version = "3.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" -dependencies = [ - "num-bigint 0.4.4", - "num-traits", - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 2.0.48", -] - [[package]] name = "env_logger" version = "0.9.3" @@ -1736,6 +1813,15 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" +dependencies = [ + "num-traits", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1766,6 +1852,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fragile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" + [[package]] name = "fs_extra" version = "1.3.0" @@ -1965,7 +2057,7 @@ dependencies = [ "indexmap 2.2.2", "slab", "tokio", - "tokio-util 0.7.10", + "tokio-util", "tracing", ] @@ -1984,7 +2076,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] @@ -1993,7 +2085,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.7", + "ahash 0.7.8", ] [[package]] @@ -2002,7 +2094,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.11", ] [[package]] @@ -2167,7 +2259,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.5", + "socket2", "tokio", "tower-service", "tracing", @@ -2201,9 +2293,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.10", + "rustls", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", ] [[package]] @@ -2292,6 +2384,25 @@ dependencies = [ "version_check", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", +] + [[package]] name = "index_list" version = "0.2.11" @@ -2306,7 +2417,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "rayon", ] [[package]] @@ -2317,6 +2427,7 @@ checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown 0.14.3", + "rayon", ] [[package]] @@ -2375,8 +2486,7 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jito-programs-vote-state" -version = "0.1.3" -source = "git+https://github.com/jito-foundation/jito-programs?rev=b8f8d315306d6ac32450bd1aa23b7c1322a83bc7#b8f8d315306d6ac32450bd1aa23b7c1322a83bc7" +version = "0.1.5" dependencies = [ "anchor-lang", "bincode", @@ -2387,12 +2497,13 @@ dependencies = [ [[package]] name = "jito-tip-distribution" -version = "0.1.2" -source = "git+https://github.com/jito-foundation/jito-programs?rev=b8f8d315306d6ac32450bd1aa23b7c1322a83bc7#b8f8d315306d6ac32450bd1aa23b7c1322a83bc7" +version = "0.1.5" dependencies = [ "anchor-lang", + "default-env", "jito-programs-vote-state", "solana-program", + "solana-security-txt", ] [[package]] @@ -2561,6 +2672,18 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "light-poseidon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" +dependencies = [ + "ark-bn254", + "ark-ff", + "num-bigint 0.4.4", + "thiserror", +] + [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2612,12 +2735,6 @@ dependencies = [ "libc", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "matchit" version = "0.7.3" @@ -2710,6 +2827,33 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mockall" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive", + "predicates", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" +dependencies = [ + "cfg-if", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 1.0.109", +] + [[package]] name = "modular-bitfield" version = "0.11.2" @@ -2778,6 +2922,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + [[package]] name = "num" version = "0.2.1" @@ -3035,25 +3185,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "opentelemetry" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand 0.8.5", - "thiserror", -] - [[package]] name = "os_str_bytes" version = "6.6.1" @@ -3280,6 +3411,36 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "predicates" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" +dependencies = [ + "difflib", + "float-cmp", + "itertools", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + [[package]] name = "prettyplease" version = "0.1.25" @@ -3306,7 +3467,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml", + "toml 0.5.11", ] [[package]] @@ -3442,54 +3603,63 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "qualifier_attr" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" +dependencies = [ + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", +] + [[package]] name = "quinn" -version = "0.9.4" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.20.9", + "rustls", "thiserror", "tokio", "tracing", - "webpki", ] [[package]] name = "quinn-proto" -version = "0.9.6" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" dependencies = [ "bytes", "rand 0.8.5", "ring 0.16.20", "rustc-hash", - "rustls 0.20.9", + "rustls", "rustls-native-certs", "slab", "thiserror", "tinyvec", "tracing", - "webpki", ] [[package]] name = "quinn-udp" -version = "0.3.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ + "bytes", "libc", - "quinn-proto", - "socket2 0.4.10", + "socket2", "tracing", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] @@ -3710,7 +3880,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.10", + "rustls", "rustls-pemfile", "serde", "serde_json", @@ -3719,8 +3889,8 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", - "tokio-util 0.7.10", + "tokio-rustls", + "tokio-util", "tower-service", "url", "wasm-bindgen", @@ -3835,25 +4005,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.16.20", - "sct", - "webpki", -] - -[[package]] -name = "rustls" -version = "0.21.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" -dependencies = [ - "log", - "ring 0.17.7", - "rustls-webpki", + "ring 0.17.7", + "rustls-webpki", "sct", ] @@ -3983,6 +4141,15 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +[[package]] +name = "seqlock" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c67b6f14ecc5b86c66fa63d76b5092352678545a8a3cdae80aef5128371910" +dependencies = [ + "parking_lot 0.12.1", +] + [[package]] name = "serde" version = "1.0.196" @@ -4023,6 +4190,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -4057,17 +4233,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "sha-1" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha1" version = "0.10.6" @@ -4125,15 +4290,6 @@ dependencies = [ "keccak", ] -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - [[package]] name = "shell-words" version = "1.1.0" @@ -4167,6 +4323,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a30f10c911c0355f80f1c2faa8096efc4a58cdf8590b954d5b395efa071c711" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "sized-chunks" version = "0.6.5" @@ -4188,9 +4350,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smpl_jwt" @@ -4208,16 +4370,6 @@ dependencies = [ "time", ] -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -4230,9 +4382,9 @@ dependencies = [ [[package]] name = "solana-account-decoder" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "815b7eeb8cfc0cc27c3500658845bc0adbfb51a9212814af522f4912e1bdab2e" +checksum = "ff098f24024f1046d9ba778c48b9a68c590c15cf5c42af67e2578a240fb141a4" dependencies = [ "Inflector", "base64 0.21.7", @@ -4243,94 +4395,108 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "solana-address-lookup-table-program", "solana-config-program", "solana-sdk", "spl-token", "spl-token-2022", + "spl-token-group-interface", "spl-token-metadata-interface", "thiserror", "zstd", ] [[package]] -name = "solana-address-lookup-table-program" -version = "1.16.23" +name = "solana-accounts-db" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9137f2199f70e082f15f91076f31fa6e67d98d40168de759feab12c6b60542a8" +checksum = "d8b18106c7a95d34a30030d00100ed2c212ece3ec166bc65ae9f4f6906ddf01e" dependencies = [ + "arrayref", "bincode", + "blake3", + "bv", "bytemuck", + "byteorder", + "bzip2", + "crossbeam-channel", + "dashmap", + "flate2", + "fnv", + "im", + "index_list", + "itertools", + "lazy_static", "log", - "num-derive 0.3.3", + "lz4", + "memmap2", + "modular-bitfield", + "num-derive 0.4.2", "num-traits", + "num_cpus", + "num_enum 0.7.2", + "ouroboros", + "percentage", + "qualifier_attr", + "rand 0.8.5", + "rayon", + "regex", "rustc_version", + "seqlock", "serde", + "serde_derive", + "smallvec", + "solana-bucket-map", + "solana-config-program", "solana-frozen-abi", "solana-frozen-abi-macro", - "solana-program", + "solana-measure", + "solana-metrics", + "solana-nohash-hasher", "solana-program-runtime", + "solana-rayon-threadlimit", "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", + "static_assertions", + "strum", + "strum_macros", + "tar", + "tempfile", "thiserror", ] [[package]] -name = "solana-banks-client" -version = "1.16.23" +name = "solana-address-lookup-table-program" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "785bca4464357f3d7aad38b3f57b1dcec5fc47f7eb3e0c1ffba907ce15aae66c" +checksum = "20d61283a078fbcac0690852434fb848e0cbf1a62e6c7b3472a8656459933134" dependencies = [ - "borsh 0.10.3", - "futures", - "solana-banks-interface", + "bincode", + "bytemuck", + "log", + "num-derive 0.4.2", + "num-traits", + "rustc_version", + "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", "solana-program", + "solana-program-runtime", "solana-sdk", - "tarpc", "thiserror", - "tokio", - "tokio-serde", -] - -[[package]] -name = "solana-banks-interface" -version = "1.16.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb13f6fff944f56df1c5b4bb708676efb856991bc368c969c436cc444e6f5e83" -dependencies = [ - "serde", - "solana-sdk", - "tarpc", -] - -[[package]] -name = "solana-banks-server" -version = "1.16.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "893926dda1a8d1594b55b753298df54fb9ed9ed1e802cac69ad3a225b7cdc63e" -dependencies = [ - "bincode", - "crossbeam-channel", - "futures", - "solana-banks-interface", - "solana-client", - "solana-runtime", - "solana-sdk", - "solana-send-transaction-service", - "tarpc", - "tokio", - "tokio-serde", ] [[package]] name = "solana-bloom" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7509b1d9823ed07deab1cfd86ee50a2b2a7775c02bc663eff7f48c6dbc0b221" +checksum = "5860ef8eec7296e4a28c155214103499e8065fdce878f96849c4594ce2f31dba" dependencies = [ "bv", "fnv", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "rustc_version", "serde", @@ -4342,15 +4508,15 @@ dependencies = [ [[package]] name = "solana-bpf-loader-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb0ed3691420f8ca6c7d58eb1335ecb0b73b1b6188039b7b631bcd0253b24377" +checksum = "55a1f4be18656ddeeb9b722b3553eb4d47cf8fa356552c0002f6e7f63c457319" dependencies = [ "bincode", "byteorder", "libsecp256k1", "log", - "rand 0.7.3", + "scopeguard", "solana-measure", "solana-program-runtime", "solana-sdk", @@ -4361,16 +4527,17 @@ dependencies = [ [[package]] name = "solana-bucket-map" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b64e2a282391cffdd2985971abf571922fd58db5f2743014f8a0428f719af2" +checksum = "461c725c2a6db405355e35bdaa2077673059b95b9859ed3d2a1ebc4e05ffd746" dependencies = [ "bv", + "bytemuck", "log", "memmap2", "modular-bitfield", - "num_enum 0.6.1", - "rand 0.7.3", + "num_enum 0.7.2", + "rand 0.8.5", "solana-measure", "solana-sdk", "tempfile", @@ -4378,14 +4545,13 @@ dependencies = [ [[package]] name = "solana-clap-utils" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a99a1aa397ec62a9b10f2f072fb95d78c6f4303bbca11d6af5f3f198e3d62e8" +checksum = "751789b7c7a3d78afe7f1ddbf48942463253167e67e85034a9695e0a05fba63e" dependencies = [ "chrono", "clap 2.34.0", "rpassword", - "solana-perf", "solana-remote-wallet", "solana-sdk", "thiserror", @@ -4396,19 +4562,19 @@ dependencies = [ [[package]] name = "solana-client" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd1d1b50f6937ec5b7b05faa171956dc052ad593d058de5046e325cc0ec4c23" +checksum = "ae5a780ff360acc9794d6e7fae8cd449c0b01bb5f0cec9c4bd8b0e6c6d111487" dependencies = [ "async-trait", "bincode", + "dashmap", "futures", "futures-util", - "indexmap 1.9.3", + "indexmap 2.2.2", "indicatif", "log", "quinn", - "rand 0.7.3", "rayon", "solana-connection-cache", "solana-measure", @@ -4429,9 +4595,9 @@ dependencies = [ [[package]] name = "solana-compute-budget-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "674cbca707a6a38dc860cef40b988debb24e0347a04cd123bd2b05cb6f75eed4" +checksum = "05b5d5f91e6e16026679364f001e2ce9231bdc83752888a84a911e3aa81fa160" dependencies = [ "solana-program-runtime", "solana-sdk", @@ -4439,9 +4605,9 @@ dependencies = [ [[package]] name = "solana-config-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7448528e2fd237e7d7ca93d4d8541a8a9f346b9f947405799d9a6dd5c22aa41c" +checksum = "3fd4f18daab90c2f703da8dc094b1dc80721178977302d66d21df43e61b4a97b" dependencies = [ "bincode", "chrono", @@ -4453,16 +4619,17 @@ dependencies = [ [[package]] name = "solana-connection-cache" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51fe3a80fc59a93392a103e6ab492305a6ac614abee70cde6e34fe74fc55dd" +checksum = "9a7b949fb3d3abc092b0c1dfb437a63d3cb7968f92d74820ef46732093517083" dependencies = [ "async-trait", "bincode", + "crossbeam-channel", "futures-util", - "indexmap 1.9.3", + "indexmap 2.2.2", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "rcgen", "solana-measure", @@ -4472,19 +4639,42 @@ dependencies = [ "tokio", ] +[[package]] +name = "solana-cost-model" +version = "1.18.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50ae48bd5f95036552951e76780021cead2cdea26aedab3c2e3617c2c3bacb32" +dependencies = [ + "lazy_static", + "log", + "rustc_version", + "solana-address-lookup-table-program", + "solana-bpf-loader-program", + "solana-compute-budget-program", + "solana-config-program", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-loader-v4-program", + "solana-metrics", + "solana-program-runtime", + "solana-sdk", + "solana-stake-program", + "solana-system-program", + "solana-vote-program", +] + [[package]] name = "solana-entry" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934c896302603683df402479d9c84478d23530bd0010dffb3020319348a824a0" +checksum = "a40a0d0c05bca1218b875270fb92433ba732c19d5afa7da3c99c453ba4aed5cf" dependencies = [ "bincode", "crossbeam-channel", - "dlopen", - "dlopen_derive", + "dlopen2", "lazy_static", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "serde", "solana-measure", @@ -4497,31 +4687,23 @@ dependencies = [ [[package]] name = "solana-frozen-abi" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8e68a37635d475c40f026bfbc39df3298ce91ec0f4db848979b1dbcd9bc675" +checksum = "3b8177685ab2bc8cc8b3bf63aa1eaa0580d5af850ecefac323ca1c2473085d77" dependencies = [ - "ahash 0.8.6", - "blake3", "block-buffer 0.10.4", "bs58 0.4.0", "bv", - "byteorder", - "cc", "either", "generic-array", - "getrandom 0.1.16", "im", "lazy_static", "log", "memmap2", - "once_cell", - "rand_core 0.6.4", "rustc_version", "serde", "serde_bytes", "serde_derive", - "serde_json", "sha2 0.10.8", "solana-frozen-abi-macro", "subtle", @@ -4530,9 +4712,9 @@ dependencies = [ [[package]] name = "solana-frozen-abi-macro" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ea45edfe53a4d95f18bd627f1b60e200611a436afd0c58c9c529c085af8965" +checksum = "4a68241cad17b74c6034a68ba4890632d409a2c886e7bead9c1e1432befdb7c9" dependencies = [ "proc-macro2 1.0.78", "quote 1.0.35", @@ -4542,25 +4724,26 @@ dependencies = [ [[package]] name = "solana-gossip" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cd9169d2b7d8eaa7e46c414503bb54e65add0aa78497a59ebe1923743aee883" +checksum = "d58c7700a66ba13a20b935a706906257cb95193de315db854c58c1bbe450e46a" dependencies = [ + "assert_matches", "bincode", "bv", "clap 2.34.0", "crossbeam-channel", "flate2", - "indexmap 1.9.3", + "indexmap 2.2.2", "itertools", "log", "lru", - "matches", "num-traits", - "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", + "rand_chacha 0.3.1", "rayon", "rustc_version", + "rustversion", "serde", "serde_bytes", "serde_derive", @@ -4583,6 +4766,7 @@ dependencies = [ "solana-thin-client", "solana-tpu-client", "solana-version", + "solana-vote", "solana-vote-program", "static_assertions", "thiserror", @@ -4590,13 +4774,13 @@ dependencies = [ [[package]] name = "solana-ledger" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd8afdb4e35c57eb2d0b2a51e295f92fb60e9e16bf1f4f16d7313b52207aab1" +checksum = "3047298d664542d444837d8f75e7fb05b133a3ec93a27d377c6d7fa375ca6616" dependencies = [ "assert_matches", "bincode", - "bitflags 1.3.2", + "bitflags 2.4.2", "byteorder", "chrono", "chrono-humanize", @@ -4609,11 +4793,12 @@ dependencies = [ "libc", "log", "lru", + "mockall", "num_cpus", - "num_enum 0.6.1", + "num_enum 0.7.2", "prost", - "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", + "rand_chacha 0.3.1", "rayon", "reed-solomon-erasure", "rocksdb", @@ -4623,7 +4808,9 @@ dependencies = [ "serde_bytes", "sha2 0.10.8", "solana-account-decoder", + "solana-accounts-db", "solana-bpf-loader-program", + "solana-cost-model", "solana-entry", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -4638,10 +4825,13 @@ dependencies = [ "solana-storage-bigtable", "solana-storage-proto", "solana-transaction-status", + "solana-vote", "solana-vote-program", "spl-token", "spl-token-2022", "static_assertions", + "strum", + "strum_macros", "tempfile", "thiserror", "tokio", @@ -4651,12 +4841,11 @@ dependencies = [ [[package]] name = "solana-loader-v4-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4091f5bc56ecd65473ad5ae4f0bae43a5ea26b916a824eaf74909ed0b0154a7d" +checksum = "dd77e6da2cc1ba4742dcef6f3e4c7025dc9bf5e36ebba681c53531fef9148b5d" dependencies = [ "log", - "rand 0.7.3", "solana-measure", "solana-program-runtime", "solana-sdk", @@ -4665,9 +4854,9 @@ dependencies = [ [[package]] name = "solana-logger" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db83d89279b0620958ae1278fd52f340c68be79980a5f6ebfb3d4e4623d7241" +checksum = "fea560989ef67ba4a1a0fd62a248721f1aa5bac8fa5ede9ccf4fe9ee484ccadf" dependencies = [ "env_logger 0.9.3", "lazy_static", @@ -4676,9 +4865,9 @@ dependencies = [ [[package]] name = "solana-measure" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6745b818b9d2d88b0011ac5532e3dcd4cde0bd1613464ee1bcb98db423ab97" +checksum = "2abdc65120ba03eac69a668c0085166e969ea6717aee1f5b0a2ffbdd07afe7a6" dependencies = [ "log", "solana-sdk", @@ -4686,20 +4875,19 @@ dependencies = [ [[package]] name = "solana-merkle-tree" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa3c7b0efa48c10d3bb93bd26e7f14f091683e71121f78ce2b01abc6b517e5d" +checksum = "350d93058a08b7a7ac36283cbbbce951da5e6d3d65c42dddd40c5a58fb4ad20d" dependencies = [ "fast-math", - "matches", "solana-program", ] [[package]] name = "solana-metrics" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5b3782e709a4546a77354e6b0fbc176a34f19b420e65c0d9c9c48f93459fbab" +checksum = "6e4874fea432f89b6ef0902fdada2cbca715b094419897dcfc7ef82d88b0a308" dependencies = [ "crossbeam-channel", "gethostname", @@ -4707,23 +4895,24 @@ dependencies = [ "log", "reqwest", "solana-sdk", + "thiserror", ] [[package]] name = "solana-net-utils" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ea302ba1a7186826fecace83da4adce9b288e97ea370999a9aee2bfc71129b" +checksum = "05afd6080d20db4dc862603178535c7d648cba7462ca23241ff5670fb0026d38" dependencies = [ "bincode", "clap 3.2.25", "crossbeam-channel", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "serde", "serde_derive", - "socket2 0.4.10", + "socket2", "solana-logger", "solana-sdk", "solana-version", @@ -4731,27 +4920,35 @@ dependencies = [ "url", ] +[[package]] +name = "solana-nohash-hasher" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8a731ed60e89177c8a7ab05fe0f1511cedd3e70e773f288f9de33a9cfdc21e" + [[package]] name = "solana-perf" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a5d5de014354c112349667c51f80ce01bca0c6b0bfa027cbc069e972c1c0c7" +checksum = "cff0f2ea9735a5452a3fe837c61f30231c8f5b455a2b12665d3bb6e0c56e49c8" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.11", "bincode", "bv", "caps", "curve25519-dalek", - "dlopen", - "dlopen_derive", + "dlopen2", "fnv", "lazy_static", "libc", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "rayon", + "rustc_version", "serde", + "solana-frozen-abi", + "solana-frozen-abi-macro", "solana-metrics", "solana-rayon-threadlimit", "solana-sdk", @@ -4760,21 +4957,21 @@ dependencies = [ [[package]] name = "solana-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2560d24192b60301c1219c054a34bcd9d9723bb64ec9b5b987882d86c32868e6" +checksum = "8bddf573103c890b4ab8f9a6641d4f969d4148bce9a451c263f4a62afa949fae" dependencies = [ "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", - "array-bytes", "base64 0.21.7", "bincode", - "bitflags 1.3.2", + "bitflags 2.4.2", "blake3", "borsh 0.10.3", "borsh 0.9.3", + "borsh 1.4.0", "bs58 0.4.0", "bv", "bytemuck", @@ -4788,14 +4985,14 @@ dependencies = [ "lazy_static", "libc", "libsecp256k1", + "light-poseidon", "log", "memoffset 0.9.0", "num-bigint 0.4.4", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits", "parking_lot 0.12.1", - "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", "rustc_version", "rustversion", "serde", @@ -4815,9 +5012,9 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1726697292d3f551898537f921749352e965510a9cfe7e7b2ff7f1a0fcc6e1db" +checksum = "e22d035b370d65bff46c7d7582a1619c4edac8e8059e2dec0e151df09882c7b3" dependencies = [ "base64 0.21.7", "bincode", @@ -4826,10 +5023,10 @@ dependencies = [ "itertools", "libc", "log", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits", "percentage", - "rand 0.7.3", + "rand 0.8.5", "rustc_version", "serde", "solana-frozen-abi", @@ -4841,38 +5038,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "solana-program-test" -version = "1.16.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c66d071392c72f4e12527fa5e13e9ab9bd23a785eda1331a597277ee8f8c0800" -dependencies = [ - "assert_matches", - "async-trait", - "base64 0.21.7", - "bincode", - "chrono-humanize", - "crossbeam-channel", - "log", - "serde", - "solana-banks-client", - "solana-banks-interface", - "solana-banks-server", - "solana-bpf-loader-program", - "solana-logger", - "solana-program-runtime", - "solana-runtime", - "solana-sdk", - "solana-vote-program", - "thiserror", - "tokio", -] - [[package]] name = "solana-pubsub-client" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f134152897fe6d3fad3da9945ae452dfc6c2d71465ddce1ad8a423d54ad38bee" +checksum = "f1b3aaa906f6b222be23423a0dd5deed254f092d27ad3bc05371acd9685d2db0" dependencies = [ "crossbeam-channel", "futures-util", @@ -4895,9 +5065,9 @@ dependencies = [ [[package]] name = "solana-quic-client" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "409c0182a32bb11acdf84c96361cff4628e93e7e8b293a8cc43e5ef354ffa46a" +checksum = "82e75ba7e460865a7f556d7b7bc59e70c049eab4448bf2528bed1c5e5a1b672d" dependencies = [ "async-mutex", "async-trait", @@ -4907,9 +5077,8 @@ dependencies = [ "log", "quinn", "quinn-proto", - "quinn-udp", "rcgen", - "rustls 0.20.9", + "rustls", "solana-connection-cache", "solana-measure", "solana-metrics", @@ -4923,9 +5092,9 @@ dependencies = [ [[package]] name = "solana-rayon-threadlimit" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce5c2d7f4e92580e6dd18877f0cd5f152e662dbda9c2eed69d29ae9a6f6e5d0" +checksum = "5a6ccb1910cc9efd4bae450d18a57c387e51ebebade1bd9bdf006ae539dd012f" dependencies = [ "lazy_static", "num_cpus", @@ -4933,14 +5102,14 @@ dependencies = [ [[package]] name = "solana-remote-wallet" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a9e49486e3f31009cfd24869de318e0fac261257f0e87e6f692e0bbf6a053b6" +checksum = "24cda66f8ed8860870cd4bf26235fb7fd08d8e5a75a4fce26b279c8d5c9db81f" dependencies = [ "console", "dialoguer", "log", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits", "parking_lot 0.12.1", "qstring", @@ -4952,9 +5121,9 @@ dependencies = [ [[package]] name = "solana-rpc-client" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336cdd2dbb4dcfdb7c905eb45fdd32de30f594b12f00d894160a8e4d12fc76a3" +checksum = "efae5c8740d8eb49e504e728de10aed0a5ddc53af3004b32ecdea2f7ca12c97b" dependencies = [ "async-trait", "base64 0.21.7", @@ -4978,9 +5147,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-api" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0cc64f5092d9c3e0bbfbd459689ffc17617b9f52773ffb7e26a2483a33d5ace" +checksum = "cdd1597ebe177b6fd68a9b33b682a5f0c9445c02be3783e7f51e570cbbbb3aa4" dependencies = [ "base64 0.21.7", "bs58 0.4.0", @@ -5000,9 +5169,9 @@ dependencies = [ [[package]] name = "solana-rpc-client-nonce-utils" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c54440695e2a3b14749b52f2021172aeb2387f8bd95f4e0cc2f97e5d27b5ea4" +checksum = "1ae385b37c59a8507b9871d5162ea7709206360a55cf2859adb4274be4a870e1" dependencies = [ "clap 2.34.0", "solana-clap-utils", @@ -5013,10 +5182,11 @@ dependencies = [ [[package]] name = "solana-runtime" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63578440eb0526fc3b3155be56c33dec115d8739e0964ec563a8ae8c80b4ffd2" +checksum = "0ebeeadbb2c6bab05e248493bb170e9e1429f180559df7f0027c71a9d486df84" dependencies = [ + "aquamarine", "arrayref", "base64 0.21.7", "bincode", @@ -5038,26 +5208,29 @@ dependencies = [ "lru", "lz4", "memmap2", + "mockall", "modular-bitfield", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits", "num_cpus", - "num_enum 0.6.1", - "once_cell", + "num_enum 0.7.2", "ouroboros", "percentage", - "rand 0.7.3", + "qualifier_attr", + "rand 0.8.5", "rayon", "regex", "rustc_version", "serde", "serde_derive", "serde_json", + "solana-accounts-db", "solana-address-lookup-table-program", "solana-bpf-loader-program", "solana-bucket-map", "solana-compute-budget-program", "solana-config-program", + "solana-cost-model", "solana-frozen-abi", "solana-frozen-abi-macro", "solana-loader-v4-program", @@ -5070,6 +5243,7 @@ dependencies = [ "solana-stake-program", "solana-system-program", "solana-version", + "solana-vote", "solana-vote-program", "solana-zk-token-proof-program", "solana-zk-token-sdk", @@ -5085,15 +5259,15 @@ dependencies = [ [[package]] name = "solana-sdk" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fc9581f8345a67da71386274084d9a2e35f25689871ad644f5992c786df7c7" +checksum = "08b24b06fa176209ddb2a2f8172a00b07e8a3b18229fbfc49f1eb3ce6ad11ff1" dependencies = [ "assert_matches", "base64 0.21.7", "bincode", - "bitflags 1.3.2", - "borsh 0.10.3", + "bitflags 2.4.2", + "borsh 1.4.0", "bs58 0.4.0", "bytemuck", "byteorder", @@ -5110,13 +5284,14 @@ dependencies = [ "libsecp256k1", "log", "memmap2", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits", - "num_enum 0.6.1", + "num_enum 0.7.2", "pbkdf2 0.11.0", "qstring", + "qualifier_attr", "rand 0.7.3", - "rand_chacha 0.2.2", + "rand 0.8.5", "rustc_version", "rustversion", "serde", @@ -5126,6 +5301,7 @@ dependencies = [ "serde_with", "sha2 0.10.8", "sha3 0.10.8", + "siphasher", "solana-frozen-abi", "solana-frozen-abi-macro", "solana-logger", @@ -5138,9 +5314,9 @@ dependencies = [ [[package]] name = "solana-sdk-macro" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d749979b74d6ca1d8b0f1da1d0333332cfac425a34d71ed1149cccc322e0533" +checksum = "869483c05f18d37d4d95a08d9e05e00a4f76a8c8349aeedeee9ba2d013cbacde" dependencies = [ "bs58 0.4.0", "proc-macro2 1.0.78", @@ -5153,29 +5329,13 @@ dependencies = [ name = "solana-security-txt" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" - -[[package]] -name = "solana-send-transaction-service" -version = "1.16.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9dad2cb6f9462e7e1c9900df76b9ad601b199aab3d26855d28bf8494698def3" -dependencies = [ - "crossbeam-channel", - "log", - "solana-client", - "solana-measure", - "solana-metrics", - "solana-runtime", - "solana-sdk", - "solana-tpu-client", -] +checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" [[package]] name = "solana-stake-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ec54610fafa934717e90e8ab0774867b054d4c3852b5ca24d5947edf14a61e1" +checksum = "ce34cbcfddcddf8316af363e7457b2420ee0507bc8ff3a16980d38c71af0e04e" dependencies = [ "bincode", "log", @@ -5188,9 +5348,9 @@ dependencies = [ [[package]] name = "solana-storage-bigtable" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b6b00589ff2ef15d76202a2d4b022c86527b64f96e127d0735784aacb15be5" +checksum = "74e38acc6570c6f211ef18adfedc6fcaa7097c505e4c315e7553f1130e7ef6e0" dependencies = [ "backoff", "bincode", @@ -5222,9 +5382,9 @@ dependencies = [ [[package]] name = "solana-storage-proto" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5188f8e47570059ff3754e6bcd2203a911db973464587151efc06327922e454b" +checksum = "651c9d7457c394f0d002ef95acfd8bb8e9e6bb501d65cbfceb3f3eff3aa75b90" dependencies = [ "bincode", "bs58 0.4.0", @@ -5239,16 +5399,16 @@ dependencies = [ [[package]] name = "solana-streamer" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a848b9b56af99988e6273ccf79f2bd816633dc3da9ea0eb4488a5b0f8ec820" +checksum = "b76711141dd5b052e29e4825b33cf09ca9cf3987b8ac0c703d36e3d80ad5dc91" dependencies = [ "async-channel", "bytes", "crossbeam-channel", "futures-util", "histogram", - "indexmap 1.9.3", + "indexmap 2.2.2", "itertools", "libc", "log", @@ -5258,10 +5418,10 @@ dependencies = [ "pkcs8", "quinn", "quinn-proto", - "quinn-udp", - "rand 0.7.3", + "rand 0.8.5", "rcgen", - "rustls 0.20.9", + "rustls", + "smallvec", "solana-metrics", "solana-perf", "solana-sdk", @@ -5272,9 +5432,9 @@ dependencies = [ [[package]] name = "solana-system-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a427a441f95ee0b9d8e2065a2978d86142c6fa40cbdccd1de724f77b6cc885af" +checksum = "50d55e3fb09b181f6b4040fc6e5038d35aa9a0c95eb182b7702b8318bf2ff0cb" dependencies = [ "bincode", "log", @@ -5286,9 +5446,9 @@ dependencies = [ [[package]] name = "solana-thin-client" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db5ba7eddcc0cefc3c5c116387097cb81bb13d7598fbdb3b40c5a964105e879" +checksum = "21b6b476b4572453f93a9827fa9312537b8a8ed253006919ab17d921b271b125" dependencies = [ "bincode", "log", @@ -5301,17 +5461,16 @@ dependencies = [ [[package]] name = "solana-tpu-client" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bdf56494fd1b509c5428f969a10e4e0865b3eaf40aac1640c8f72dac3112b89" +checksum = "9cfa13af3f54db31bde6f2d5462588f03be95f7cf66610d5942e7b52e556d1d9" dependencies = [ "async-trait", "bincode", "futures-util", - "indexmap 1.9.3", + "indexmap 2.2.2", "indicatif", "log", - "rand 0.7.3", "rayon", "solana-connection-cache", "solana-measure", @@ -5326,9 +5485,9 @@ dependencies = [ [[package]] name = "solana-transaction-status" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3c52eaa1977b0121a099243de4b5b44de936e67869d3298400fb6e974a2f7b" +checksum = "5b5614e42e4d5a8b15e4553b68008788fae3a0dbc1a3672b62e9574252579536" dependencies = [ "Inflector", "base64 0.21.7", @@ -5341,7 +5500,6 @@ dependencies = [ "serde_derive", "serde_json", "solana-account-decoder", - "solana-address-lookup-table-program", "solana-sdk", "spl-associated-token-account", "spl-memo", @@ -5352,9 +5510,9 @@ dependencies = [ [[package]] name = "solana-udp-client" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1225fb057b8b5e5aa5b0ee01b974e6ef2c6f01727dfd217c23b89b6547a8b17b" +checksum = "22a37626fc851db74838725fc1034a71f2b2445149d93e45884ae366c6d85d61" dependencies = [ "async-trait", "solana-connection-cache", @@ -5367,9 +5525,9 @@ dependencies = [ [[package]] name = "solana-version" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f7b09ffc8f5446bee6ee1ab4ce4c98504d23222313de1d0ed762f736a3ffe3" +checksum = "7c23651369dd7278308c988078adeb593a37560abd0f728f70e768e12fa4b507" dependencies = [ "log", "rustc_version", @@ -5381,15 +5539,34 @@ dependencies = [ "solana-sdk", ] +[[package]] +name = "solana-vote" +version = "1.18.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cc7a6e32de8a455bf85090a2a7bf4c298fc4ca02279f2829896ee0a28a94272" +dependencies = [ + "crossbeam-channel", + "itertools", + "log", + "rustc_version", + "serde", + "serde_derive", + "solana-frozen-abi", + "solana-frozen-abi-macro", + "solana-sdk", + "solana-vote-program", + "thiserror", +] + [[package]] name = "solana-vote-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be239ebe1d73af268ce9ba5111ce9595a430aa98576105e87b00e92a5ef2a0b" +checksum = "6f0bab220b03482b90aa1781f7c4d4f073c7c9e7eafe6759d07a1b3efee6e315" dependencies = [ "bincode", "log", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits", "rustc_version", "serde", @@ -5405,13 +5582,12 @@ dependencies = [ [[package]] name = "solana-zk-token-proof-program" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a813c2c577b9eb24b62d7149d1e5340425f55650f3ff6a01eb2ded828a95774" +checksum = "f77771c8c8d2f8f645a0626e57f72f6c6a83beb5bebb6fd4d7662f7bcc98deea" dependencies = [ "bytemuck", - "getrandom 0.1.16", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits", "solana-program-runtime", "solana-sdk", @@ -5420,9 +5596,9 @@ dependencies = [ [[package]] name = "solana-zk-token-sdk" -version = "1.16.23" +version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4b0547480462cfec9dddaa8adcf2fa7c8b022021738bf71c790c0c7be54a34" +checksum = "459c27f7b954798677d8243aa53b8080cfb314ecfecbf8889a5a65c91ad11fee" dependencies = [ "aes-gcm-siv", "base64 0.21.7", @@ -5434,7 +5610,7 @@ dependencies = [ "itertools", "lazy_static", "merlin", - "num-derive 0.3.3", + "num-derive 0.4.2", "num-traits", "rand 0.7.3", "serde", @@ -5449,9 +5625,9 @@ dependencies = [ [[package]] name = "solana_rbpf" -version = "0.6.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d4ba1e58947346e360fabde0697029d36ba83c42f669199b16a8931313cf29" +checksum = "3d457cc2ba742c120492a64b7fa60e22c575e891f6b55039f4d736568fb112a3" dependencies = [ "byteorder", "combine", @@ -5490,9 +5666,9 @@ dependencies = [ [[package]] name = "spl-associated-token-account" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" +checksum = "992d9c64c2564cc8f63a4b508bf3ebcdf2254b0429b13cd1d31adb6162432a5f" dependencies = [ "assert_matches", "borsh 0.10.3", @@ -5588,9 +5764,9 @@ dependencies = [ [[package]] name = "spl-tlv-account-resolution" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" +checksum = "56f335787add7fa711819f9e7c573f8145a5358a709446fe2d24bf2a88117c90" dependencies = [ "bytemuck", "solana-program", @@ -5617,9 +5793,9 @@ dependencies = [ [[package]] name = "spl-token-2022" -version = "0.9.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" +checksum = "d697fac19fd74ff472dfcc13f0b442dd71403178ce1de7b5d16f83a33561c059" dependencies = [ "arrayref", "bytemuck", @@ -5627,16 +5803,31 @@ dependencies = [ "num-traits", "num_enum 0.7.2", "solana-program", + "solana-security-txt", "solana-zk-token-sdk", "spl-memo", "spl-pod", "spl-token", + "spl-token-group-interface", "spl-token-metadata-interface", "spl-transfer-hook-interface", "spl-type-length-value", "thiserror", ] +[[package]] +name = "spl-token-group-interface" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b889509d49fa74a4a033ca5dae6c2307e9e918122d97e58562f5c4ffa795c75d" +dependencies = [ + "bytemuck", + "solana-program", + "spl-discriminator", + "spl-pod", + "spl-program-error", +] + [[package]] name = "spl-token-metadata-interface" version = "0.2.0" @@ -5653,9 +5844,9 @@ dependencies = [ [[package]] name = "spl-transfer-hook-interface" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" +checksum = "7aabdb7c471566f6ddcee724beb8618449ea24b399e58d464d6b5bc7db550259" dependencies = [ "arrayref", "bytemuck", @@ -5765,6 +5956,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.78", + "quote 1.0.35", + "syn 2.0.48", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -5815,41 +6018,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "tarpc" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" -dependencies = [ - "anyhow", - "fnv", - "futures", - "humantime", - "opentelemetry", - "pin-project", - "rand 0.8.5", - "serde", - "static_assertions", - "tarpc-plugins", - "thiserror", - "tokio", - "tokio-serde", - "tokio-util 0.6.10", - "tracing", - "tracing-opentelemetry", -] - -[[package]] -name = "tarpc-plugins" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" -dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", - "syn 1.0.109", -] - [[package]] name = "tempfile" version = "3.10.0" @@ -5872,29 +6040,10 @@ dependencies = [ ] [[package]] -name = "tests" -version = "0.1.0" -dependencies = [ - "anchor-lang", - "bincode", - "bv", - "bytemuck", - "cfg-if", - "ed25519-dalek", - "futures", - "jito-tip-distribution", - "matches", - "rand 0.7.3", - "semver", - "serde", - "serde_derive", - "solana-gossip", - "solana-program-test", - "solana-sdk", - "solana-version", - "validator-history", - "validator-history-vote-state", -] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "textwrap" @@ -5931,16 +6080,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "time" version = "0.3.34" @@ -6020,7 +6159,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -6056,43 +6195,16 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki", -] - [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls", "tokio", ] -[[package]] -name = "tokio-serde" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" -dependencies = [ - "bincode", - "bytes", - "educe", - "futures-core", - "futures-sink", - "pin-project", - "serde", - "serde_json", -] - [[package]] name = "tokio-stream" version = "0.1.14" @@ -6106,33 +6218,17 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.17.2" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f714dd15bead90401d77e04243611caec13726c2408afd5b31901dfcdcb3b181" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.20.9", + "rustls", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls", "tungstenite", - "webpki", - "webpki-roots 0.22.6", -] - -[[package]] -name = "tokio-util" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "slab", - "tokio", + "webpki-roots 0.25.4", ] [[package]] @@ -6158,11 +6254,26 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.12", +] + [[package]] name = "toml_datetime" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -6172,7 +6283,7 @@ checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.2.2", "toml_datetime", - "winnow", + "winnow 0.5.39", ] [[package]] @@ -6183,19 +6294,32 @@ checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap 2.2.2", "toml_datetime", - "winnow", + "winnow 0.5.39", +] + +[[package]] +name = "toml_edit" +version = "0.22.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +dependencies = [ + "indexmap 2.2.2", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.6", ] [[package]] name = "tonic" -version = "0.8.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.13.1", + "base64 0.21.7", "bytes", "futures-core", "futures-util", @@ -6207,24 +6331,21 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "prost-derive", "rustls-pemfile", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls", "tokio-stream", - "tokio-util 0.7.10", "tower", "tower-layer", "tower-service", "tracing", - "tracing-futures", ] [[package]] name = "tonic-build" -version = "0.8.4" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf5e9b9c0f7e0a7c027dcfaba7b2c60816c7049171f679d99ee2ff65d0de8c4" +checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" dependencies = [ "prettyplease 0.1.25", "proc-macro2 1.0.78", @@ -6247,7 +6368,7 @@ dependencies = [ "rand 0.8.5", "slab", "tokio", - "tokio-util 0.7.10", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -6295,41 +6416,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - -[[package]] -name = "tracing-opentelemetry" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" -dependencies = [ - "once_cell", - "opentelemetry", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", ] [[package]] @@ -6346,24 +6432,23 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.17.3" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" dependencies = [ - "base64 0.13.1", "byteorder", "bytes", + "data-encoding", "http", "httparse", "log", "rand 0.8.5", - "rustls 0.20.9", - "sha-1", + "rustls", + "sha1", "thiserror", "url", "utf-8", - "webpki", - "webpki-roots 0.22.6", + "webpki-roots 0.24.0", ] [[package]] @@ -6529,7 +6614,6 @@ dependencies = [ "clap 4.4.18", "futures", "futures-util", - "jito-tip-distribution", "log", "solana-account-decoder", "solana-clap-utils", @@ -6562,7 +6646,6 @@ dependencies = [ "env_logger 0.10.2", "futures", "futures-util", - "jito-tip-distribution", "keeper-core", "log", "solana-account-decoder", @@ -6579,12 +6662,6 @@ dependencies = [ "validator-history", ] -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "vcpkg" version = "0.2.15" @@ -6716,23 +6793,13 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.7", - "untrusted 0.9.0", -] - [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "webpki", + "rustls-webpki", ] [[package]] @@ -6793,21 +6860,6 @@ dependencies = [ "windows-targets 0.52.0", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -6856,12 +6908,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.0", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -6874,12 +6920,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -6892,12 +6932,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -6910,12 +6944,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -6928,12 +6956,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -6946,12 +6968,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -6964,12 +6980,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -6991,6 +7001,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" diff --git a/Cargo.toml b/Cargo.toml index 0b351b7f..706e2ee6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,10 @@ members = [ "keepers/*", "programs/*", - "tests", + # "tests", "utils/*" ] + + +[profile.release] +overflow-checks = true \ No newline at end of file diff --git a/idls/jito_tip_distribution.json b/idls/jito_tip_distribution.json new file mode 100644 index 00000000..087c9dc6 --- /dev/null +++ b/idls/jito_tip_distribution.json @@ -0,0 +1,489 @@ +{ + "address": "", + "metadata": { + "name": "jito_tip_distribution", + "version": "0.1.5", + "spec": "0.1.0", + "description": "Tip distribution program, responsible for distributing funds to entitled parties." + }, + "instructions": [ + { + "name": "initialize", + "docs": ["Initialize a singleton instance of the [Config] account."], + "discriminator": [175, 175, 109, 31, 13, 152, 155, 237], + "accounts": [ + { + "name": "config", + "writable": true + }, + { + "name": "system_program" + }, + { + "name": "initializer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "expired_funds_account", + "type": "pubkey" + }, + { + "name": "num_epochs_valid", + "type": "u64" + }, + { + "name": "max_validator_commission_bps", + "type": "u16" + }, + { + "name": "bump", + "type": "u8" + } + ] + }, + { + "name": "initialize_tip_distribution_account", + "docs": [ + "Initialize a new [TipDistributionAccount] associated with the given validator vote key", + "and current epoch." + ], + "discriminator": [120, 191, 25, 182, 111, 49, 179, 55], + "accounts": [ + { + "name": "config" + }, + { + "name": "tip_distribution_account", + "writable": true + }, + { + "name": "validator_vote_account", + "docs": [ + "The validator's vote account is used to check this transaction's signer is also the authorized withdrawer." + ] + }, + { + "name": "signer", + "docs": [ + "Must be equal to the supplied validator vote account's authorized withdrawer." + ], + "writable": true, + "signer": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "merkle_root_upload_authority", + "type": "pubkey" + }, + { + "name": "validator_commission_bps", + "type": "u16" + }, + { + "name": "bump", + "type": "u8" + } + ] + }, + { + "name": "update_config", + "docs": [ + "Update config fields. Only the [Config] authority can invoke this." + ], + "discriminator": [29, 158, 252, 191, 10, 83, 219, 99], + "accounts": [ + { + "name": "config", + "writable": true + }, + { + "name": "authority", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "new_config", + "type": { + "defined": { + "name": "jito_tip_distribution::state::Config" + } + } + } + ] + }, + { + "name": "upload_merkle_root", + "docs": [ + "Uploads a merkle root to the provided [TipDistributionAccount]. This instruction may be", + "invoked many times as long as the account is at least one epoch old and not expired; and", + "no funds have already been claimed. Only the `merkle_root_upload_authority` has the", + "authority to invoke." + ], + "discriminator": [70, 3, 110, 29, 199, 190, 205, 176], + "accounts": [ + { + "name": "config" + }, + { + "name": "tip_distribution_account", + "writable": true + }, + { + "name": "merkle_root_upload_authority", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "root", + "type": { + "array": ["u8", 32] + } + }, + { + "name": "max_total_claim", + "type": "u64" + }, + { + "name": "max_num_nodes", + "type": "u64" + } + ] + }, + { + "name": "close_claim_status", + "docs": [ + "Anyone can invoke this only after the [TipDistributionAccount] has expired.", + "This instruction will return any rent back to `claimant` and close the account" + ], + "discriminator": [163, 214, 191, 165, 245, 188, 17, 185], + "accounts": [ + { + "name": "config" + }, + { + "name": "claim_status", + "writable": true + }, + { + "name": "claim_status_payer", + "docs": ["Receiver of the funds."], + "writable": true + } + ], + "args": [] + }, + { + "name": "close_tip_distribution_account", + "docs": [ + "Anyone can invoke this only after the [TipDistributionAccount] has expired.", + "This instruction will send any unclaimed funds to the designated `expired_funds_account`", + "before closing and returning the rent exempt funds to the validator." + ], + "discriminator": [47, 136, 208, 190, 125, 243, 74, 227], + "accounts": [ + { + "name": "config" + }, + { + "name": "expired_funds_account", + "writable": true + }, + { + "name": "tip_distribution_account", + "writable": true + }, + { + "name": "validator_vote_account", + "writable": true + }, + { + "name": "signer", + "docs": ["Anyone can crank this instruction."], + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "_epoch", + "type": "u64" + } + ] + }, + { + "name": "claim", + "docs": ["Claims tokens from the [TipDistributionAccount]."], + "discriminator": [62, 198, 214, 193, 213, 159, 108, 210], + "accounts": [ + { + "name": "config" + }, + { + "name": "tip_distribution_account", + "writable": true + }, + { + "name": "claim_status", + "docs": [ + "Status of the claim. Used to prevent the same party from claiming multiple times." + ], + "writable": true + }, + { + "name": "claimant", + "docs": ["Receiver of the funds."], + "writable": true + }, + { + "name": "payer", + "docs": ["Who is paying for the claim."], + "writable": true, + "signer": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "proof", + "type": { + "vec": { + "array": ["u8", 32] + } + } + } + ] + } + ], + "accounts": [ + { + "name": "jito_tip_distribution::state::ClaimStatus", + "discriminator": [22, 183, 249, 157, 247, 95, 150, 96] + }, + { + "name": "jito_tip_distribution::state::Config", + "discriminator": [155, 12, 170, 224, 30, 250, 204, 130] + }, + { + "name": "jito_tip_distribution::state::TipDistributionAccount", + "discriminator": [85, 64, 113, 198, 234, 94, 120, 123] + } + ], + "types": [ + { + "name": "jito_tip_distribution::state::ClaimStatus", + "docs": [ + "Gives us an audit trail of who and what was claimed; also enforces and only-once claim by any party." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "is_claimed", + "docs": ["If true, the tokens have been claimed."], + "type": "bool" + }, + { + "name": "claimant", + "docs": [ + "Authority that claimed the tokens. Allows for delegated rewards claiming." + ], + "type": "pubkey" + }, + { + "name": "claim_status_payer", + "docs": ["The payer who created the claim."], + "type": "pubkey" + }, + { + "name": "slot_claimed_at", + "docs": ["When the funds were claimed."], + "type": "u64" + }, + { + "name": "amount", + "docs": ["Amount of funds claimed."], + "type": "u64" + }, + { + "name": "expires_at", + "docs": [ + "The epoch (upto and including) that tip funds can be claimed.", + "Copied since TDA can be closed, need to track to avoid making multiple claims" + ], + "type": "u64" + }, + { + "name": "bump", + "docs": ["The bump used to generate this account"], + "type": "u8" + } + ] + } + }, + { + "name": "jito_tip_distribution::state::Config", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "docs": ["Account with authority over this PDA."], + "type": "pubkey" + }, + { + "name": "expired_funds_account", + "docs": [ + "We want to expire funds after some time so that validators can be refunded the rent.", + "Expired funds will get transferred to this account." + ], + "type": "pubkey" + }, + { + "name": "num_epochs_valid", + "docs": [ + "Specifies the number of epochs a merkle root is valid for before expiring." + ], + "type": "u64" + }, + { + "name": "max_validator_commission_bps", + "docs": [ + "The maximum commission a validator can set on their distribution account." + ], + "type": "u16" + }, + { + "name": "bump", + "docs": ["The bump used to generate this account"], + "type": "u8" + } + ] + } + }, + { + "name": "jito_tip_distribution::state::MerkleRoot", + "type": { + "kind": "struct", + "fields": [ + { + "name": "root", + "docs": ["The 256-bit merkle root."], + "type": { + "array": ["u8", 32] + } + }, + { + "name": "max_total_claim", + "docs": [ + "Maximum number of funds that can ever be claimed from this [MerkleRoot]." + ], + "type": "u64" + }, + { + "name": "max_num_nodes", + "docs": [ + "Maximum number of nodes that can ever be claimed from this [MerkleRoot]." + ], + "type": "u64" + }, + { + "name": "total_funds_claimed", + "docs": ["Total funds that have been claimed."], + "type": "u64" + }, + { + "name": "num_nodes_claimed", + "docs": ["Number of nodes that have been claimed."], + "type": "u64" + } + ] + } + }, + { + "name": "jito_tip_distribution::state::TipDistributionAccount", + "docs": [ + "The account that validators register as **tip_receiver** with the tip-payment program." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "validator_vote_account", + "docs": [ + "The validator's vote account, also the recipient of remaining lamports after", + "upon closing this account." + ], + "type": "pubkey" + }, + { + "name": "merkle_root_upload_authority", + "docs": [ + "The only account authorized to upload a merkle-root for this account." + ], + "type": "pubkey" + }, + { + "name": "merkle_root", + "docs": [ + "The merkle root used to verify user claims from this account." + ], + "type": { + "option": { + "defined": { + "name": "jito_tip_distribution::state::MerkleRoot" + } + } + } + }, + { + "name": "epoch_created_at", + "docs": ["Epoch for which this account was created."], + "type": "u64" + }, + { + "name": "validator_commission_bps", + "docs": ["The commission basis points this validator charges."], + "type": "u16" + }, + { + "name": "expires_at", + "docs": [ + "The epoch (upto and including) that tip funds can be claimed." + ], + "type": "u64" + }, + { + "name": "bump", + "docs": ["The bump used to generate this account"], + "type": "u8" + } + ] + } + } + ] +} diff --git a/keepers/keeper-core/Cargo.toml b/keepers/keeper-core/Cargo.toml index 0aa016fb..a4770a97 100644 --- a/keepers/keeper-core/Cargo.toml +++ b/keepers/keeper-core/Cargo.toml @@ -11,9 +11,9 @@ bincode = "1.3.3" clap = { version = "4.3.0", features = ["derive"] } futures = "0.3.21" log = "0.4.18" -solana-client = "1.16" -solana-metrics = "1.16" -solana-program = "1.16" -solana-sdk = "1.16" +solana-client = "1.18" +solana-metrics = "1.18" +solana-program = "1.18" +solana-sdk = "1.18" thiserror = "1.0.37" tokio = { version = "1.36.0", features = ["full"] } diff --git a/keepers/validator-keeper/Cargo.toml b/keepers/validator-keeper/Cargo.toml index b3e195f1..52031b5a 100644 --- a/keepers/validator-keeper/Cargo.toml +++ b/keepers/validator-keeper/Cargo.toml @@ -5,24 +5,23 @@ edition = "2021" description = "Script to keep validator history accounts up to date" [dependencies] -anchor-lang = "0.28.0" +anchor-lang = "0.30.0" bytemuck = { version = "1.4.0", features = ["derive", "min_const_generics"] } clap = { version = "4.3.0", features = ["derive", "env"] } env_logger = "0.10.0" futures = "0.3.21" futures-util = "0.3.21" -jito-tip-distribution = { git = "https://github.com/jito-foundation/jito-programs", rev = "b8f8d315306d6ac32450bd1aa23b7c1322a83bc7" } keeper-core = { path = "../keeper-core" } log = "0.4.18" -solana-account-decoder = "1.16" -solana-clap-utils = "1.16" -solana-client = "1.16" -solana-gossip = "1.16" -solana-metrics = "1.16" -solana-net-utils = "1.16" -solana-program = "1.16" -solana-sdk = "1.16" -solana-streamer = "1.16" +solana-account-decoder = "1.18" +solana-clap-utils = "1.18" +solana-client = "1.18" +solana-gossip = "1.18" +solana-metrics = "1.18" +solana-net-utils = "1.18" +solana-program = "1.18" +solana-sdk = "1.18" +solana-streamer = "1.18" thiserror = "1.0.37" tokio = { version = "1.36.0", features = ["full"] } validator-history = { features = ["no-entrypoint"], path = "../../programs/validator-history" } diff --git a/keepers/validator-keeper/src/lib.rs b/keepers/validator-keeper/src/lib.rs index 286be460..83fdb670 100644 --- a/keepers/validator-keeper/src/lib.rs +++ b/keepers/validator-keeper/src/lib.rs @@ -3,7 +3,9 @@ use std::{ sync::{atomic::AtomicBool, Arc}, }; -use anchor_lang::{AccountDeserialize, Discriminator}; +use anchor_lang::{ + prelude::account, AccountDeserialize, AnchorDeserialize, AnchorSerialize, Discriminator, +}; use keeper_core::{ get_vote_accounts_with_retry, CreateUpdateStats, MultipleAccountsError, SubmitStats, TransactionExecutionError, @@ -28,7 +30,6 @@ use solana_sdk::{ }; use solana_streamer::socket::SocketAddrSpace; -use jito_tip_distribution::state::TipDistributionAccount; use thiserror::Error as ThisError; use validator_history::{ constants::MIN_VOTE_EPOCHS, ClusterHistory, ValidatorHistory, ValidatorHistoryEntry, @@ -54,6 +55,53 @@ pub enum KeeperError { Custom(String), } +// TODO: can we use anchor's declare-program macro here? +/// Copied from https://github.com/jito-foundation/jito-programs/blob/master/mev-programs/programs/tip-distribution/src/state.rs#L102 to remove the dependency on that program +/// The account that validators register as **tip_receiver** with the tip-payment program. +#[account] +#[derive(Default)] +pub struct TipDistributionAccount { + /// The validator's vote account, also the recipient of remaining lamports after + /// upon closing this account. + pub validator_vote_account: Pubkey, + + /// The only account authorized to upload a merkle-root for this account. + pub merkle_root_upload_authority: Pubkey, + + /// The merkle root used to verify user claims from this account. + pub merkle_root: Option, + + /// Epoch for which this account was created. + pub epoch_created_at: u64, + + /// The commission basis points this validator charges. + pub validator_commission_bps: u16, + + /// The epoch (upto and including) that tip funds can be claimed. + pub expires_at: u64, + + /// The bump used to generate this account + pub bump: u8, +} + +#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] +pub struct MerkleRoot { + /// The 256-bit merkle root. + pub root: [u8; 32], + + /// Maximum number of funds that can ever be claimed from this [MerkleRoot]. + pub max_total_claim: u64, + + /// Maximum number of nodes that can ever be claimed from this [MerkleRoot]. + pub max_num_nodes: u64, + + /// Total funds that have been claimed. + pub total_funds_claimed: u64, + + /// Number of nodes that have been claimed. + pub num_nodes_claimed: u64, +} + pub async fn get_tip_distribution_accounts( rpc_client: &RpcClient, tip_distribution_program: &Pubkey, diff --git a/keepers/validator-keeper/src/mev_commission.rs b/keepers/validator-keeper/src/mev_commission.rs index f6286b63..dd9fa5f3 100644 --- a/keepers/validator-keeper/src/mev_commission.rs +++ b/keepers/validator-keeper/src/mev_commission.rs @@ -1,8 +1,7 @@ use std::{collections::HashMap, str::FromStr, sync::Arc}; +use crate::TipDistributionAccount; use anchor_lang::{AccountDeserialize, InstructionData, ToAccountMetas}; -use jito_tip_distribution::sdk::derive_tip_distribution_account_address; -use jito_tip_distribution::state::TipDistributionAccount; use keeper_core::{ build_create_and_update_instructions, get_multiple_accounts_batched, get_vote_accounts_with_retry, submit_create_and_update, Address, CreateTransaction, @@ -14,7 +13,11 @@ use solana_client::rpc_response::RpcVoteAccountInfo; use solana_program::{instruction::Instruction, pubkey::Pubkey}; use solana_sdk::{signature::Keypair, signer::Signer}; use validator_history::constants::MIN_VOTE_EPOCHS; -use validator_history::{constants::MAX_ALLOC_BYTES, Config, ValidatorHistory}; +use validator_history::{ + constants::{MAX_ALLOC_BYTES, MIN_VOTE_EPOCHS}, + utils::derive_tip_distribution_account_address, + Config, ValidatorHistory, +}; use crate::KeeperError; diff --git a/programs/validator-history/Cargo.toml b/programs/validator-history/Cargo.toml index b813a273..9f23a624 100644 --- a/programs/validator-history/Cargo.toml +++ b/programs/validator-history/Cargo.toml @@ -20,13 +20,13 @@ no-log-ix-name = [] cpi = ["no-entrypoint"] default = ["custom-heap"] custom-heap = [] +idl-build = ["anchor-lang/idl-build"] [dependencies] -anchor-lang = "0.28.0" +anchor-lang = "0.30.0" bincode = "1.3.3" bytemuck = { version = "1.13.1", features = ["derive", "min_const_generics"] } cfg-if = "1.0.0" -jito-tip-distribution = { git = "https://github.com/jito-foundation/jito-programs", rev = "b8f8d315306d6ac32450bd1aa23b7c1322a83bc7", features = ["no-entrypoint"] } semver = "1.0.17" serde = "1.0.183" serde_derive = "1.0.183" @@ -35,3 +35,5 @@ static_assertions = "1.1.0" thiserror = "1.0.37" type-layout = "0.2" validator-history-vote-state = { path = "../../utils/vote-state" } + +jito-tip-distribution = { features = ["no-entrypoint"], path = "../../../jito-programs/mev-programs/programs/tip-distribution" } diff --git a/programs/validator-history/src/constants.rs b/programs/validator-history/src/constants.rs index 990e9342..aa284863 100644 --- a/programs/validator-history/src/constants.rs +++ b/programs/validator-history/src/constants.rs @@ -1,2 +1,3 @@ pub const MAX_ALLOC_BYTES: usize = 10240; pub const MIN_VOTE_EPOCHS: usize = 5; +pub const TIP_DISTRIBUTION_ACCOUNT_SEED: &'static [u8] = b"TIP_DISTRIBUTION_ACCOUNT"; diff --git a/programs/validator-history/src/instructions/initialize_config.rs b/programs/validator-history/src/instructions/initialize_config.rs index e24de39d..66687529 100644 --- a/programs/validator-history/src/instructions/initialize_config.rs +++ b/programs/validator-history/src/instructions/initialize_config.rs @@ -20,7 +20,7 @@ pub struct InitializeConfig<'info> { pub fn handle_initialize_config(ctx: Context, authority: Pubkey) -> Result<()> { ctx.accounts.config.oracle_authority = authority; ctx.accounts.config.admin = authority; - ctx.accounts.config.bump = *ctx.bumps.get("config").unwrap(); + ctx.accounts.config.bump = ctx.bumps.config; ctx.accounts.config.counter = 0; Ok(()) } diff --git a/programs/validator-history/src/instructions/realloc_cluster_history_account.rs b/programs/validator-history/src/instructions/realloc_cluster_history_account.rs index 26967178..0e6705bd 100644 --- a/programs/validator-history/src/instructions/realloc_cluster_history_account.rs +++ b/programs/validator-history/src/instructions/realloc_cluster_history_account.rs @@ -48,7 +48,7 @@ pub fn handle_realloc_cluster_history_account( // Can actually initialize values now that the account is proper size let mut cluster_history_account = ctx.accounts.cluster_history_account.load_mut()?; - cluster_history_account.bump = *ctx.bumps.get("cluster_history_account").unwrap(); + cluster_history_account.bump = ctx.bumps.cluster_history_account; cluster_history_account.struct_version = 0; cluster_history_account.history.idx = (cluster_history_account.history.arr.len() - 1) as u64; diff --git a/programs/validator-history/src/instructions/realloc_validator_history_account.rs b/programs/validator-history/src/instructions/realloc_validator_history_account.rs index c0f562e4..66b30f88 100644 --- a/programs/validator-history/src/instructions/realloc_validator_history_account.rs +++ b/programs/validator-history/src/instructions/realloc_validator_history_account.rs @@ -58,7 +58,7 @@ pub fn handle_realloc_validator_history_account( validator_history_account.index = ctx.accounts.config.counter; ctx.accounts.config.counter += 1; - validator_history_account.bump = *ctx.bumps.get("validator_history_account").unwrap(); + validator_history_account.bump = ctx.bumps.validator_history_account; validator_history_account.vote_account = *ctx.accounts.vote_account.key; validator_history_account.struct_version = ValidatorHistoryVersion::V0 as u32; validator_history_account.history.idx = diff --git a/programs/validator-history/src/lib.rs b/programs/validator-history/src/lib.rs index d038794e..cbd4a264 100644 --- a/programs/validator-history/src/lib.rs +++ b/programs/validator-history/src/lib.rs @@ -12,6 +12,8 @@ pub mod utils; pub use instructions::*; pub use state::*; +// declare_program!(jito_tip_distribution); + cfg_if::cfg_if! { if #[cfg(feature = "mainnet-beta")] { declare_id!("HistoryJTGbKQD2mRgLZ3XhqHnN811Qpez8X9kCcGHoa"); diff --git a/programs/validator-history/src/utils.rs b/programs/validator-history/src/utils.rs index 13c44da1..64c5fe12 100644 --- a/programs/validator-history/src/utils.rs +++ b/programs/validator-history/src/utils.rs @@ -1,10 +1,10 @@ use anchor_lang::{ prelude::{AccountInfo, Pubkey, Result}, require, - solana_program::native_token::lamports_to_sol, + solana_program::{clock::Epoch, native_token::lamports_to_sol}, }; -use crate::errors::ValidatorHistoryError; +use crate::{constants::TIP_DISTRIBUTION_ACCOUNT_SEED, errors::ValidatorHistoryError}; pub fn cast_epoch(epoch: u64) -> Result { require!( @@ -36,6 +36,21 @@ pub fn get_vote_account(validator_history_account_info: &AccountInfo) -> Pubkey Pubkey::from(data) } +pub fn derive_tip_distribution_account_address( + tip_distribution_program_id: &Pubkey, + vote_pubkey: &Pubkey, + epoch: Epoch, +) -> (Pubkey, u8) { + Pubkey::find_program_address( + &[ + TIP_DISTRIBUTION_ACCOUNT_SEED, + vote_pubkey.to_bytes().as_ref(), + epoch.to_le_bytes().as_ref(), + ], + tip_distribution_program_id, + ) +} + #[cfg(test)] mod tests { use super::*; diff --git a/tests/Cargo.toml b/tests/Cargo.toml index d3688d7c..e68f72dc 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -7,22 +7,21 @@ license = "Apache-2.0" authors = ["Jito Foundation "] [dependencies] -anchor-lang = "0.28.0" +anchor-lang = "0.30.0" bincode = "1.3.3" bv = "0.11.1" bytemuck = { version = "1.13.1", features = ["derive", "min_const_generics"] } cfg-if = "1.0.0" ed25519-dalek = "1.0.1" futures = "0.3.25" -jito-tip-distribution = { git = "https://github.com/jito-foundation/jito-programs", rev = "b8f8d315306d6ac32450bd1aa23b7c1322a83bc7", features = ["no-entrypoint"] } matches = "0.1.10" rand = "0.7.3" semver = "1.0.17" serde = "1.0.183" serde_derive = "1.0.183" -solana-gossip = "1.16" -solana-program-test = "1.16" -solana-sdk = "1.16" -solana-version = "1.16" +solana-gossip = "1.18" +solana-program-test = "1.18" +solana-sdk = "1.18" +solana-version = "1.18" validator-history = { features = ["no-entrypoint"], path = "../programs/validator-history" } validator-history-vote-state = { path = "../utils/vote-state" } diff --git a/tests/src/fixtures.rs b/tests/src/fixtures.rs index 90c8d6b5..63f19b7a 100644 --- a/tests/src/fixtures.rs +++ b/tests/src/fixtures.rs @@ -8,17 +8,20 @@ use { }, AccountSerialize, InstructionData, ToAccountMetas, }, - jito_tip_distribution::{ - sdk::derive_tip_distribution_account_address, - state::{MerkleRoot, TipDistributionAccount}, - }, + // jito_tip_distribution::{ + // sdk::derive_tip_distribution_account_address, + // state::{MerkleRoot, TipDistributionAccount}, + // }, solana_program_test::*, solana_sdk::{ account::Account, epoch_schedule::EpochSchedule, instruction::Instruction, signature::Keypair, signer::Signer, transaction::Transaction, }, std::{cell::RefCell, rc::Rc}, - validator_history::{self, constants::MAX_ALLOC_BYTES, ClusterHistory, ValidatorHistory}, + validator_history::{ + self, constants::MAX_ALLOC_BYTES, utils::derive_tip_distribution_account_address, + ClusterHistory, ValidatorHistory, + }, }; pub struct TestFixture { diff --git a/utils/validator-history-cli/Cargo.toml b/utils/validator-history-cli/Cargo.toml index ed067e11..6b4cb880 100644 --- a/utils/validator-history-cli/Cargo.toml +++ b/utils/validator-history-cli/Cargo.toml @@ -5,18 +5,17 @@ edition = "2021" description = "CLI to manage validator history program" [dependencies] -anchor-lang = "0.28.0" +anchor-lang = "0.30.0" clap = { version = "4.3.0", features = ["derive", "env"] } futures = "0.3.21" futures-util = "0.3.21" -jito-tip-distribution = { git = "https://github.com/jito-foundation/jito-programs", rev = "b8f8d315306d6ac32450bd1aa23b7c1322a83bc7" } log = "0.4.18" -solana-account-decoder = "1.16" -solana-clap-utils = "1.16" -solana-client = "1.16" -solana-metrics = "1.16" -solana-program = "1.16" -solana-sdk = "1.16" +solana-account-decoder = "1.18" +solana-clap-utils = "1.18" +solana-client = "1.18" +solana-metrics = "1.18" +solana-program = "1.18" +solana-sdk = "1.18" thiserror = "1.0.37" tokio = { version = "1.36.0", features = ["full"] } validator-history = { features = ["no-entrypoint"], path = "../../programs/validator-history" } diff --git a/utils/vote-state/Cargo.toml b/utils/vote-state/Cargo.toml index 1b64a15f..df7655ef 100644 --- a/utils/vote-state/Cargo.toml +++ b/utils/vote-state/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" authors = ["Jito Foundation "] [dependencies] -anchor-lang = "0.28.0" +anchor-lang = "0.30.0" bincode = "1.3.3" serde = { version = "1.0.138", features = ["derive"] } -solana-program = "1.16" +solana-program = "1.18" From 02ea0c386de08d1427fa7ca919ef5ef382fac9e1 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Wed, 1 May 2024 11:40:45 -0400 Subject: [PATCH 03/11] Superminority range --- programs/validator-history/src/state.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/programs/validator-history/src/state.rs b/programs/validator-history/src/state.rs index 96eececd..4b8c1322 100644 --- a/programs/validator-history/src/state.rs +++ b/programs/validator-history/src/state.rs @@ -244,6 +244,21 @@ impl CircBuf { None } + pub fn superminority_range(&self, start_epoch: u16, end_epoch: u16) -> Vec> { + field_range!(self, start_epoch, end_epoch, is_superminority, u8) + .into_iter() + .map(|maybe_value| { + maybe_value.and_then(|value| { + if value == 0 || value == 1 { + Some(value) + } else { + None + } + }) + }) + .collect() + } + pub fn vote_account_last_update_slot_latest(&self) -> Option { field_latest!(self, vote_account_last_update_slot) } From 1df8ee12847703be2c8e92d820fe8805fbcb53f3 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Wed, 1 May 2024 17:30:37 -0400 Subject: [PATCH 04/11] progress on working idl --- Anchor.toml | 4 +- Cargo.lock | 332 +++++------- idls/jito_tip_distribution.json | 505 +++++++++++++----- keepers/validator-keeper/Cargo.toml | 1 + keepers/validator-keeper/src/gossip.rs | 4 +- keepers/validator-keeper/src/lib.rs | 53 +- .../validator-keeper/src/mev_commission.rs | 5 +- keepers/validator-keeper/src/stake.rs | 5 +- keepers/validator-keeper/src/vote_account.rs | 3 +- programs/validator-history/Cargo.toml | 2 +- .../src/instructions/backfill_total_blocks.rs | 9 +- .../copy_tip_distribution_account.rs | 2 +- programs/validator-history/src/lib.rs | 1 - programs/validator-history/src/state.rs | 7 +- utils/validator-history-cli/src/main.rs | 2 +- 15 files changed, 553 insertions(+), 382 deletions(-) diff --git a/Anchor.toml b/Anchor.toml index 77068aa4..bd0c5c7d 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -1,5 +1,5 @@ [features] -seeds = false +resolution = false skip-lint = false [programs.localnet] validator_history = "HistoryJTGbKQD2mRgLZ3XhqHnN811Qpez8X9kCcGHoa" @@ -18,4 +18,4 @@ cluster = "Localnet" wallet = "~/.config/solana/id.json" [scripts] -test = "cargo +nightly test" \ No newline at end of file +test = "cargo +nightly test" diff --git a/Cargo.lock b/Cargo.lock index c4d622d6..ec654f5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,8 +124,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd7368e171b3a317885dc08ec0f74eed9d0ad6c726cc819593aed81440dca926" dependencies = [ "anchor-syn", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -137,8 +137,8 @@ checksum = "f527df85a8cba3f2bea04e46ed71b66e525ea378c7fec538aa205f4520b73e31" dependencies = [ "anchor-syn", "bs58 0.5.0", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -149,7 +149,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3eb1dc1845cf8636c2e046a274ca074dabd3884ac8ed11cc4ed64b7e8ef5a318" dependencies = [ "anchor-syn", - "quote 1.0.35", + "quote", "syn 1.0.109", ] @@ -160,7 +160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f382e41514c59a77ffa7bb1a47df9a0359564a749b6934485c742c11962e540" dependencies = [ "anchor-syn", - "quote 1.0.35", + "quote", "syn 1.0.109", ] @@ -171,8 +171,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "473a122aeed3f6b666438236338d2ef7833ee5fdc5688e1baa80185d61088a53" dependencies = [ "anchor-syn", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -187,8 +187,8 @@ dependencies = [ "anyhow", "bs58 0.5.0", "heck 0.3.3", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "serde_json", "syn 1.0.109", ] @@ -200,7 +200,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed9b97c99dcec135aae0ff908c14bcfcd3e78cfc16a0c6f245135038f0e6d390" dependencies = [ "anchor-syn", - "quote 1.0.35", + "quote", "syn 1.0.109", ] @@ -212,8 +212,8 @@ checksum = "bbece98f6ad9c37070edc0841326c9623a249346cd74f433e7cef69b14f7f31d" dependencies = [ "anchor-syn", "borsh-derive-internal 0.10.3", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -223,8 +223,8 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8badbe2648bc99a85ee05a7a5f9512e5e2af8ffac71476a69350cb278057ac53" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -277,8 +277,8 @@ dependencies = [ "bs58 0.5.0", "cargo_toml", "heck 0.3.3", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "serde", "serde_json", "sha2 0.10.8", @@ -373,8 +373,8 @@ dependencies = [ "include_dir", "itertools", "proc-macro-error", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -438,7 +438,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" dependencies = [ - "quote 1.0.35", + "quote", "syn 1.0.109", ] @@ -450,8 +450,8 @@ checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint 0.4.4", "num-traits", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -486,8 +486,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -541,8 +541,8 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", "synstructure", ] @@ -553,8 +553,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -615,8 +615,8 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -626,8 +626,8 @@ version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -777,8 +777,8 @@ dependencies = [ "lazycell", "peeking_take_while", "prettyplease 0.2.16", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "regex", "rustc-hash", "shlex", @@ -887,7 +887,7 @@ dependencies = [ "borsh-derive-internal 0.9.3", "borsh-schema-derive-internal 0.9.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.78", + "proc-macro2", "syn 1.0.109", ] @@ -900,7 +900,7 @@ dependencies = [ "borsh-derive-internal 0.10.3", "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.78", + "proc-macro2", "syn 1.0.109", ] @@ -912,8 +912,8 @@ checksum = "51670c3aa053938b0ee3bd67c3817e471e626151131b934038e83c5bf8de48f5" dependencies = [ "once_cell", "proc-macro-crate 3.1.0", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", "syn_derive", ] @@ -924,8 +924,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -935,8 +935,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -946,8 +946,8 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -957,8 +957,8 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1029,8 +1029,8 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -1222,8 +1222,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -1450,8 +1450,8 @@ checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "strsim 0.10.0", "syn 2.0.48", ] @@ -1463,7 +1463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" dependencies = [ "darling_core", - "quote 1.0.35", + "quote", "syn 2.0.48", ] @@ -1487,17 +1487,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" -[[package]] -name = "default-env" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f753eb82d29277e79efc625e84aecacfd4851ee50e05a8573a4740239a77bfd3" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", -] - [[package]] name = "der" version = "0.5.1" @@ -1542,8 +1531,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -1600,8 +1589,8 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -1623,8 +1612,8 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -1711,8 +1700,8 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03cdc46ec28bd728e67540c528013c6a10eb69a02eb31078a1bda695438cbfb8" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -1918,8 +1907,8 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -2399,8 +2388,8 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", ] [[package]] @@ -2487,6 +2476,7 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jito-programs-vote-state" version = "0.1.5" +source = "git+https://github.com/jito-foundation/jito-programs?rev=50d450e993cb2278bcf97cd01b19e8a4f1f56e8e#50d450e993cb2278bcf97cd01b19e8a4f1f56e8e" dependencies = [ "anchor-lang", "bincode", @@ -2498,9 +2488,9 @@ dependencies = [ [[package]] name = "jito-tip-distribution" version = "0.1.5" +source = "git+https://github.com/jito-foundation/jito-programs?rev=50d450e993cb2278bcf97cd01b19e8a4f1f56e8e#50d450e993cb2278bcf97cd01b19e8a4f1f56e8e" dependencies = [ "anchor-lang", - "default-env", "jito-programs-vote-state", "solana-program", "solana-security-txt", @@ -2849,8 +2839,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ "cfg-if", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -2870,8 +2860,8 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -2986,8 +2976,8 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -2997,8 +2987,8 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -3078,8 +3068,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.3.1", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -3090,8 +3080,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ "proc-macro-crate 3.1.0", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -3152,8 +3142,8 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -3209,8 +3199,8 @@ checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3341,8 +3331,8 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -3447,7 +3437,7 @@ version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ - "proc-macro2 1.0.78", + "proc-macro2", "syn 1.0.109", ] @@ -3457,7 +3447,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ - "proc-macro2 1.0.78", + "proc-macro2", "syn 2.0.48", ] @@ -3496,8 +3486,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", "version_check", ] @@ -3508,25 +3498,16 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "version_check", ] [[package]] name = "proc-macro2" -version = "0.4.30" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -3571,8 +3552,8 @@ checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -3609,8 +3590,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e2e25ee72f5b24d773cae88422baddefff7714f97aab68d96fe2b6fc4a28fb2" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -3662,22 +3643,13 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - [[package]] name = "quote" version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "proc-macro2 1.0.78", + "proc-macro2", ] [[package]] @@ -4097,8 +4069,8 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -4174,8 +4146,8 @@ version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -4228,8 +4200,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ "darling", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -4716,8 +4688,8 @@ version = "1.18.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a68241cad17b74c6034a68ba4890632d409a2c886e7bead9c1e1432befdb7c9" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "rustc_version", "syn 2.0.48", ] @@ -5319,8 +5291,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "869483c05f18d37d4d95a08d9e05e00a4f76a8c8349aeedeee9ba2d013cbacde" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "rustversion", "syn 2.0.48", ] @@ -5697,7 +5669,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" dependencies = [ - "quote 1.0.35", + "quote", "spl-discriminator-syn", "syn 2.0.48", ] @@ -5708,8 +5680,8 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "sha2 0.10.8", "syn 2.0.48", "thiserror", @@ -5756,8 +5728,8 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "sha2 0.10.8", "syn 2.0.48", ] @@ -5905,8 +5877,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "rustversion", "syn 1.0.109", ] @@ -5923,25 +5895,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - [[package]] name = "syn" version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "unicode-ident", ] @@ -5951,8 +5912,8 @@ version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "unicode-ident", ] @@ -5963,8 +5924,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -5980,10 +5941,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", - "unicode-xid 0.2.4", + "unicode-xid", ] [[package]] @@ -6075,8 +6036,8 @@ version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -6180,8 +6141,8 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -6348,9 +6309,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" dependencies = [ "prettyplease 0.1.25", - "proc-macro2 1.0.78", + "proc-macro2", "prost-build", - "quote 1.0.35", + "quote", "syn 1.0.109", ] @@ -6404,8 +6365,8 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -6467,8 +6428,8 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc4a1cf66ce820973c4b31c5ef47a8e930a53ffbcec191212c33f5a3ad75c6cd" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 1.0.109", ] @@ -6511,12 +6472,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - [[package]] name = "unicode-xid" version = "0.2.4" @@ -6646,6 +6601,7 @@ dependencies = [ "env_logger 0.10.2", "futures", "futures-util", + "jito-tip-distribution", "keeper-core", "log", "solana-account-decoder", @@ -6736,8 +6692,8 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", "wasm-bindgen-shared", ] @@ -6760,7 +6716,7 @@ version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ - "quote 1.0.35", + "quote", "wasm-bindgen-macro-support", ] @@ -6770,8 +6726,8 @@ version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -7073,8 +7029,8 @@ version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] @@ -7093,8 +7049,8 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.78", - "quote 1.0.35", + "proc-macro2", + "quote", "syn 2.0.48", ] diff --git a/idls/jito_tip_distribution.json b/idls/jito_tip_distribution.json index 087c9dc6..0b8b397a 100644 --- a/idls/jito_tip_distribution.json +++ b/idls/jito_tip_distribution.json @@ -1,5 +1,5 @@ { - "address": "", + "address": "4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7", "metadata": { "name": "jito_tip_distribution", "version": "0.1.5", @@ -7,6 +7,120 @@ "description": "Tip distribution program, responsible for distributing funds to entitled parties." }, "instructions": [ + { + "name": "claim", + "docs": ["Claims tokens from the [TipDistributionAccount]."], + "discriminator": [62, 198, 214, 193, 213, 159, 108, 210], + "accounts": [ + { + "name": "config" + }, + { + "name": "tip_distribution_account", + "writable": true + }, + { + "name": "claim_status", + "docs": [ + "Status of the claim. Used to prevent the same party from claiming multiple times." + ], + "writable": true + }, + { + "name": "claimant", + "docs": ["Receiver of the funds."], + "writable": true + }, + { + "name": "payer", + "docs": ["Who is paying for the claim."], + "writable": true, + "signer": true + }, + { + "name": "system_program" + } + ], + "args": [ + { + "name": "bump", + "type": "u8" + }, + { + "name": "amount", + "type": "u64" + }, + { + "name": "proof", + "type": { + "vec": { + "array": ["u8", 32] + } + } + } + ] + }, + { + "name": "close_claim_status", + "docs": [ + "Anyone can invoke this only after the [TipDistributionAccount] has expired.", + "This instruction will return any rent back to `claimant` and close the account" + ], + "discriminator": [163, 214, 191, 165, 245, 188, 17, 185], + "accounts": [ + { + "name": "config" + }, + { + "name": "claim_status", + "writable": true + }, + { + "name": "claim_status_payer", + "docs": ["Receiver of the funds."], + "writable": true + } + ], + "args": [] + }, + { + "name": "close_tip_distribution_account", + "docs": [ + "Anyone can invoke this only after the [TipDistributionAccount] has expired.", + "This instruction will send any unclaimed funds to the designated `expired_funds_account`", + "before closing and returning the rent exempt funds to the validator." + ], + "discriminator": [47, 136, 208, 190, 125, 243, 74, 227], + "accounts": [ + { + "name": "config" + }, + { + "name": "expired_funds_account", + "writable": true + }, + { + "name": "tip_distribution_account", + "writable": true + }, + { + "name": "validator_vote_account", + "writable": true + }, + { + "name": "signer", + "docs": ["Anyone can crank this instruction."], + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "_epoch", + "type": "u64" + } + ] + }, { "name": "initialize", "docs": ["Initialize a singleton instance of the [Config] account."], @@ -118,7 +232,7 @@ "name": "new_config", "type": { "defined": { - "name": "jito_tip_distribution::state::Config" + "name": "Config" } } } @@ -163,139 +277,136 @@ "type": "u64" } ] + } + ], + "accounts": [ + { + "name": "ClaimStatus", + "discriminator": [22, 183, 249, 157, 247, 95, 150, 96] }, { - "name": "close_claim_status", - "docs": [ - "Anyone can invoke this only after the [TipDistributionAccount] has expired.", - "This instruction will return any rent back to `claimant` and close the account" - ], - "discriminator": [163, 214, 191, 165, 245, 188, 17, 185], - "accounts": [ - { - "name": "config" - }, - { - "name": "claim_status", - "writable": true - }, - { - "name": "claim_status_payer", - "docs": ["Receiver of the funds."], - "writable": true - } - ], - "args": [] + "name": "Config", + "discriminator": [155, 12, 170, 224, 30, 250, 204, 130] }, { - "name": "close_tip_distribution_account", - "docs": [ - "Anyone can invoke this only after the [TipDistributionAccount] has expired.", - "This instruction will send any unclaimed funds to the designated `expired_funds_account`", - "before closing and returning the rent exempt funds to the validator." - ], - "discriminator": [47, 136, 208, 190, 125, 243, 74, 227], - "accounts": [ - { - "name": "config" - }, - { - "name": "expired_funds_account", - "writable": true - }, - { - "name": "tip_distribution_account", - "writable": true - }, - { - "name": "validator_vote_account", - "writable": true - }, - { - "name": "signer", - "docs": ["Anyone can crank this instruction."], - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "_epoch", - "type": "u64" - } - ] + "name": "TipDistributionAccount", + "discriminator": [85, 64, 113, 198, 234, 94, 120, 123] + } + ], + "events": [ + { + "name": "ClaimStatusClosedEvent", + "discriminator": [188, 143, 237, 229, 192, 182, 164, 118] }, { - "name": "claim", - "docs": ["Claims tokens from the [TipDistributionAccount]."], - "discriminator": [62, 198, 214, 193, 213, 159, 108, 210], - "accounts": [ - { - "name": "config" - }, - { - "name": "tip_distribution_account", - "writable": true - }, - { - "name": "claim_status", - "docs": [ - "Status of the claim. Used to prevent the same party from claiming multiple times." - ], - "writable": true - }, - { - "name": "claimant", - "docs": ["Receiver of the funds."], - "writable": true - }, - { - "name": "payer", - "docs": ["Who is paying for the claim."], - "writable": true, - "signer": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "bump", - "type": "u8" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "proof", - "type": { - "vec": { - "array": ["u8", 32] - } - } - } - ] + "name": "ClaimedEvent", + "discriminator": [144, 172, 209, 86, 144, 87, 84, 115] + }, + { + "name": "ConfigUpdatedEvent", + "discriminator": [245, 158, 129, 99, 60, 100, 214, 220] + }, + { + "name": "MerkleRootUploadAuthorityUpdatedEvent", + "discriminator": [83, 157, 58, 165, 200, 171, 8, 106] + }, + { + "name": "MerkleRootUploadedEvent", + "discriminator": [94, 233, 236, 49, 52, 224, 181, 167] + }, + { + "name": "TipDistributionAccountClosedEvent", + "discriminator": [246, 152, 49, 154, 9, 79, 25, 58] + }, + { + "name": "TipDistributionAccountInitializedEvent", + "discriminator": [39, 165, 224, 61, 40, 140, 139, 255] + }, + { + "name": "ValidatorCommissionBpsUpdatedEvent", + "discriminator": [4, 34, 92, 25, 228, 88, 51, 206] } ], - "accounts": [ + "errors": [ { - "name": "jito_tip_distribution::state::ClaimStatus", - "discriminator": [22, 183, 249, 157, 247, 95, 150, 96] + "code": 6000, + "name": "AccountValidationFailure", + "msg": "Account failed validation." }, { - "name": "jito_tip_distribution::state::Config", - "discriminator": [155, 12, 170, 224, 30, 250, 204, 130] + "code": 6001, + "name": "ArithmeticError", + "msg": "Encountered an arithmetic under/overflow error." }, { - "name": "jito_tip_distribution::state::TipDistributionAccount", - "discriminator": [85, 64, 113, 198, 234, 94, 120, 123] + "code": 6002, + "name": "ExceedsMaxClaim", + "msg": "The maximum number of funds to be claimed has been exceeded." + }, + { + "code": 6003, + "name": "ExceedsMaxNumNodes", + "msg": "The maximum number of claims has been exceeded." + }, + { + "code": 6004, + "name": "ExpiredTipDistributionAccount", + "msg": "The given TipDistributionAccount has expired." + }, + { + "code": 6005, + "name": "FundsAlreadyClaimed", + "msg": "The funds for the given index and TipDistributionAccount have already been claimed." + }, + { + "code": 6006, + "name": "InvalidParameters", + "msg": "Supplied invalid parameters." + }, + { + "code": 6007, + "name": "InvalidProof", + "msg": "The given proof is invalid." + }, + { + "code": 6008, + "name": "InvalidVoteAccountData", + "msg": "Failed to deserialize the supplied vote account data." + }, + { + "code": 6009, + "name": "MaxValidatorCommissionFeeBpsExceeded", + "msg": "Validator's commission basis points must be less than or equal to the Config account's max_validator_commission_bps." + }, + { + "code": 6010, + "name": "PrematureCloseTipDistributionAccount", + "msg": "The given TipDistributionAccount is not ready to be closed." + }, + { + "code": 6011, + "name": "PrematureCloseClaimStatus", + "msg": "The given ClaimStatus account is not ready to be closed." + }, + { + "code": 6012, + "name": "PrematureMerkleRootUpload", + "msg": "Must wait till at least one epoch after the tip distribution account was created to upload the merkle root." + }, + { + "code": 6013, + "name": "RootNotUploaded", + "msg": "No merkle root has been uploaded to the given TipDistributionAccount." + }, + { + "code": 6014, + "name": "Unauthorized", + "msg": "Unauthorized signer." } ], "types": [ { - "name": "jito_tip_distribution::state::ClaimStatus", + "name": "ClaimStatus", "docs": [ "Gives us an audit trail of who and what was claimed; also enforces and only-once claim by any party." ], @@ -346,7 +457,55 @@ } }, { - "name": "jito_tip_distribution::state::Config", + "name": "ClaimStatusClosedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "claim_status_payer", + "docs": ["Account where funds were transferred to."], + "type": "pubkey" + }, + { + "name": "claim_status_account", + "docs": ["[ClaimStatus] account that was closed."], + "type": "pubkey" + } + ] + } + }, + { + "name": "ClaimedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "tip_distribution_account", + "docs": ["[TipDistributionAccount] claimed from."], + "type": "pubkey" + }, + { + "name": "payer", + "docs": [ + "User that paid for the claim, may or may not be the same as claimant." + ], + "type": "pubkey" + }, + { + "name": "claimant", + "docs": ["Account that received the funds."], + "type": "pubkey" + }, + { + "name": "amount", + "docs": ["Amount of funds to distribute."], + "type": "u64" + } + ] + } + }, + { + "name": "Config", "type": { "kind": "struct", "fields": [ @@ -386,7 +545,20 @@ } }, { - "name": "jito_tip_distribution::state::MerkleRoot", + "name": "ConfigUpdatedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "docs": ["Who updated it."], + "type": "pubkey" + } + ] + } + }, + { + "name": "MerkleRoot", "type": { "kind": "struct", "fields": [ @@ -425,7 +597,41 @@ } }, { - "name": "jito_tip_distribution::state::TipDistributionAccount", + "name": "MerkleRootUploadAuthorityUpdatedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "old_authority", + "type": "pubkey" + }, + { + "name": "new_authority", + "type": "pubkey" + } + ] + } + }, + { + "name": "MerkleRootUploadedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "merkle_root_upload_authority", + "docs": ["Who uploaded the root."], + "type": "pubkey" + }, + { + "name": "tip_distribution_account", + "docs": ["Where the root was uploaded to."], + "type": "pubkey" + } + ] + } + }, + { + "name": "TipDistributionAccount", "docs": [ "The account that validators register as **tip_receiver** with the tip-payment program." ], @@ -455,7 +661,7 @@ "type": { "option": { "defined": { - "name": "jito_tip_distribution::state::MerkleRoot" + "name": "MerkleRoot" } } } @@ -484,6 +690,61 @@ } ] } + }, + { + "name": "TipDistributionAccountClosedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "expired_funds_account", + "docs": ["Account where unclaimed funds were transferred to."], + "type": "pubkey" + }, + { + "name": "tip_distribution_account", + "docs": ["[TipDistributionAccount] closed."], + "type": "pubkey" + }, + { + "name": "expired_amount", + "docs": ["Unclaimed amount transferred."], + "type": "u64" + } + ] + } + }, + { + "name": "TipDistributionAccountInitializedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "tip_distribution_account", + "type": "pubkey" + } + ] + } + }, + { + "name": "ValidatorCommissionBpsUpdatedEvent", + "type": { + "kind": "struct", + "fields": [ + { + "name": "tip_distribution_account", + "type": "pubkey" + }, + { + "name": "old_commission_bps", + "type": "u16" + }, + { + "name": "new_commission_bps", + "type": "u16" + } + ] + } } ] } diff --git a/keepers/validator-keeper/Cargo.toml b/keepers/validator-keeper/Cargo.toml index 52031b5a..33218b74 100644 --- a/keepers/validator-keeper/Cargo.toml +++ b/keepers/validator-keeper/Cargo.toml @@ -12,6 +12,7 @@ env_logger = "0.10.0" futures = "0.3.21" futures-util = "0.3.21" keeper-core = { path = "../keeper-core" } +jito-tip-distribution = { features = ["no-entrypoint"], git = "https://github.com/jito-foundation/jito-programs", rev = "50d450e993cb2278bcf97cd01b19e8a4f1f56e8e" } log = "0.4.18" solana-account-decoder = "1.18" solana-clap-utils = "1.18" diff --git a/keepers/validator-keeper/src/gossip.rs b/keepers/validator-keeper/src/gossip.rs index c4270704..8ab78c8b 100644 --- a/keepers/validator-keeper/src/gossip.rs +++ b/keepers/validator-keeper/src/gossip.rs @@ -31,7 +31,7 @@ use tokio::time::sleep; use validator_history::{ self, constants::{MAX_ALLOC_BYTES, MIN_VOTE_EPOCHS}, - Config, ValidatorHistory, + ValidatorHistory, Config, }; use crate::{get_validator_history_accounts_with_retry, start_spy_server}; @@ -287,7 +287,7 @@ pub async fn upload_gossip_values( ); let exit: Arc = Arc::new(AtomicBool::new(false)); let (_gossip_service, cluster_info) = - start_spy_server(entrypoint, gossip_port, spy_socket_addr, &keypair, &exit); + start_spy_server(entrypoint, gossip_port, spy_socket_addr, &keypair, exit.clone()); let vote_accounts = get_vote_accounts_with_retry(&client, MIN_VOTE_EPOCHS, None).await?; let validator_history_accounts = diff --git a/keepers/validator-keeper/src/lib.rs b/keepers/validator-keeper/src/lib.rs index fc36e32f..8e345611 100644 --- a/keepers/validator-keeper/src/lib.rs +++ b/keepers/validator-keeper/src/lib.rs @@ -4,7 +4,8 @@ use std::{ }; use anchor_lang::{ - prelude::account, AccountDeserialize, AnchorDeserialize, AnchorSerialize, Discriminator, + declare_program, prelude::borsh, AccountDeserialize, AnchorDeserialize, AnchorSerialize, + Discriminator, }; use keeper_core::{ get_vote_accounts_with_retry, CreateUpdateStats, MultipleAccountsError, SubmitStats, @@ -34,6 +35,7 @@ use thiserror::Error as ThisError; use validator_history::{ constants::MIN_VOTE_EPOCHS, ClusterHistory, ValidatorHistory, ValidatorHistoryEntry, }; +use jito_tip_distribution::state::TipDistributionAccount; pub mod cluster_info; pub mod gossip; @@ -57,53 +59,6 @@ pub enum KeeperError { Custom(String), } -// TODO: can we use anchor's declare-program macro here? -/// Copied from https://github.com/jito-foundation/jito-programs/blob/master/mev-programs/programs/tip-distribution/src/state.rs#L102 to remove the dependency on that program -/// The account that validators register as **tip_receiver** with the tip-payment program. -#[account] -#[derive(Default)] -pub struct TipDistributionAccount { - /// The validator's vote account, also the recipient of remaining lamports after - /// upon closing this account. - pub validator_vote_account: Pubkey, - - /// The only account authorized to upload a merkle-root for this account. - pub merkle_root_upload_authority: Pubkey, - - /// The merkle root used to verify user claims from this account. - pub merkle_root: Option, - - /// Epoch for which this account was created. - pub epoch_created_at: u64, - - /// The commission basis points this validator charges. - pub validator_commission_bps: u16, - - /// The epoch (upto and including) that tip funds can be claimed. - pub expires_at: u64, - - /// The bump used to generate this account - pub bump: u8, -} - -#[derive(AnchorSerialize, AnchorDeserialize, Clone, Default)] -pub struct MerkleRoot { - /// The 256-bit merkle root. - pub root: [u8; 32], - - /// Maximum number of funds that can ever be claimed from this [MerkleRoot]. - pub max_total_claim: u64, - - /// Maximum number of nodes that can ever be claimed from this [MerkleRoot]. - pub max_num_nodes: u64, - - /// Total funds that have been claimed. - pub total_funds_claimed: u64, - - /// Number of nodes that have been claimed. - pub num_nodes_claimed: u64, -} - pub async fn get_tip_distribution_accounts( rpc_client: &RpcClient, tip_distribution_program: &Pubkey, @@ -315,7 +270,7 @@ pub fn start_spy_server( gossip_port: u16, spy_socket_addr: SocketAddr, keypair: &Arc, - exit: &Arc, + exit: Arc, ) -> (GossipService, Arc) { // bind socket to expected port let (_, gossip_socket) = bind_in_range( diff --git a/keepers/validator-keeper/src/mev_commission.rs b/keepers/validator-keeper/src/mev_commission.rs index 804bb561..98506738 100644 --- a/keepers/validator-keeper/src/mev_commission.rs +++ b/keepers/validator-keeper/src/mev_commission.rs @@ -1,6 +1,5 @@ use std::{collections::HashMap, str::FromStr, sync::Arc}; -use crate::TipDistributionAccount; use anchor_lang::{AccountDeserialize, InstructionData, ToAccountMetas}; use keeper_core::{ build_create_and_update_instructions, get_multiple_accounts_batched, @@ -12,12 +11,12 @@ use solana_client::nonblocking::rpc_client::RpcClient; use solana_client::rpc_response::RpcVoteAccountInfo; use solana_program::{instruction::Instruction, pubkey::Pubkey}; use solana_sdk::{signature::Keypair, signer::Signer}; -use validator_history::constants::MIN_VOTE_EPOCHS; use validator_history::{ constants::{MAX_ALLOC_BYTES, MIN_VOTE_EPOCHS}, utils::derive_tip_distribution_account_address, - Config, ValidatorHistory, + ValidatorHistory, Config, }; +use jito_tip_distribution::state::TipDistributionAccount; use crate::{KeeperError, PRIORITY_FEE}; diff --git a/keepers/validator-keeper/src/stake.rs b/keepers/validator-keeper/src/stake.rs index 5296b642..638b2be5 100644 --- a/keepers/validator-keeper/src/stake.rs +++ b/keepers/validator-keeper/src/stake.rs @@ -19,7 +19,7 @@ use solana_sdk::{ }; use validator_history::{ constants::{MAX_ALLOC_BYTES, MIN_VOTE_EPOCHS}, - state::{Config, ValidatorHistory}, + state::{ValidatorHistory, Config}, }; use crate::{KeeperError, PRIORITY_FEE}; @@ -55,7 +55,8 @@ impl StakeHistoryEntry { &[ValidatorHistory::SEED, &vote_pubkey.to_bytes()], program_id, ); - let (config_address, _) = Pubkey::find_program_address(&[Config::SEED], program_id); + let (config_address, _) = + Pubkey::find_program_address(&[Config::SEED], program_id); StakeHistoryEntry { stake: vote_account.activated_stake, diff --git a/keepers/validator-keeper/src/vote_account.rs b/keepers/validator-keeper/src/vote_account.rs index 5d06de41..b9715ad3 100644 --- a/keepers/validator-keeper/src/vote_account.rs +++ b/keepers/validator-keeper/src/vote_account.rs @@ -34,7 +34,8 @@ impl CopyVoteAccountEntry { &[ValidatorHistory::SEED, &vote_account.to_bytes()], program_id, ); - let (config_address, _) = Pubkey::find_program_address(&[Config::SEED], program_id); + let (config_address, _) = + Pubkey::find_program_address(&[Config::SEED], program_id); Self { vote_account: *vote_account, validator_history_account, diff --git a/programs/validator-history/Cargo.toml b/programs/validator-history/Cargo.toml index 9f23a624..9ec05de6 100644 --- a/programs/validator-history/Cargo.toml +++ b/programs/validator-history/Cargo.toml @@ -27,6 +27,7 @@ anchor-lang = "0.30.0" bincode = "1.3.3" bytemuck = { version = "1.13.1", features = ["derive", "min_const_generics"] } cfg-if = "1.0.0" +jito-tip-distribution = { features = ["no-entrypoint"], git = "https://github.com/jito-foundation/jito-programs", rev = "50d450e993cb2278bcf97cd01b19e8a4f1f56e8e" } semver = "1.0.17" serde = "1.0.183" serde_derive = "1.0.183" @@ -36,4 +37,3 @@ thiserror = "1.0.37" type-layout = "0.2" validator-history-vote-state = { path = "../../utils/vote-state" } -jito-tip-distribution = { features = ["no-entrypoint"], path = "../../../jito-programs/mev-programs/programs/tip-distribution" } diff --git a/programs/validator-history/src/instructions/backfill_total_blocks.rs b/programs/validator-history/src/instructions/backfill_total_blocks.rs index becea1f2..b910e921 100644 --- a/programs/validator-history/src/instructions/backfill_total_blocks.rs +++ b/programs/validator-history/src/instructions/backfill_total_blocks.rs @@ -1,6 +1,6 @@ use anchor_lang::prelude::*; -use crate::{errors::ValidatorHistoryError, utils::cast_epoch, ClusterHistory, Config}; +use crate::{errors::ValidatorHistoryError, utils::cast_epoch, state::{ClusterHistory, Config}}; #[derive(Accounts)] pub struct BackfillTotalBlocks<'info> { @@ -10,9 +10,12 @@ pub struct BackfillTotalBlocks<'info> { bump, )] pub cluster_history_account: AccountLoader<'info, ClusterHistory>, + #[account( + has_one = oracle_authority + )] pub config: Account<'info, Config>, - #[account(mut, address = config.oracle_authority )] - pub signer: Signer<'info>, + #[account(mut)] + pub oracle_authority: Signer<'info>, } pub fn handle_backfill_total_blocks( diff --git a/programs/validator-history/src/instructions/copy_tip_distribution_account.rs b/programs/validator-history/src/instructions/copy_tip_distribution_account.rs index be132ec0..7f96ae1d 100644 --- a/programs/validator-history/src/instructions/copy_tip_distribution_account.rs +++ b/programs/validator-history/src/instructions/copy_tip_distribution_account.rs @@ -35,7 +35,7 @@ pub struct CopyTipDistributionAccount<'info> { /// `owner = config.tip_distribution_program.key()` here is sufficient. #[account( seeds = [ - TipDistributionAccount::SEED, + b"TIP_DISTRIBUTION_ACCOUNT", vote_account.key().as_ref(), epoch.to_le_bytes().as_ref(), ], diff --git a/programs/validator-history/src/lib.rs b/programs/validator-history/src/lib.rs index cbd4a264..affe33d5 100644 --- a/programs/validator-history/src/lib.rs +++ b/programs/validator-history/src/lib.rs @@ -12,7 +12,6 @@ pub mod utils; pub use instructions::*; pub use state::*; -// declare_program!(jito_tip_distribution); cfg_if::cfg_if! { if #[cfg(feature = "mainnet-beta")] { diff --git a/programs/validator-history/src/state.rs b/programs/validator-history/src/state.rs index 4b8c1322..8c05e218 100644 --- a/programs/validator-history/src/state.rs +++ b/programs/validator-history/src/state.rs @@ -37,7 +37,7 @@ impl Config { static_assertions::const_assert_eq!(size_of::(), 128); -#[derive(AnchorSerialize, TypeLayout)] +#[derive(TypeLayout)] #[zero_copy] pub struct ValidatorHistoryEntry { pub activated_stake_lamports: u64, @@ -103,7 +103,6 @@ pub struct ClientVersion { const MAX_ITEMS: usize = 512; -#[derive(AnchorSerialize)] #[zero_copy] pub struct CircBuf { pub idx: u64, @@ -270,7 +269,6 @@ pub enum ValidatorHistoryVersion { static_assertions::const_assert_eq!(size_of::(), 65848); -#[derive(AnchorSerialize)] #[account(zero_copy)] pub struct ValidatorHistory { // Cannot be enum due to Pod and Zeroable trait limitations @@ -658,7 +656,6 @@ impl ValidatorHistory { } } -#[derive(AnchorSerialize)] #[account(zero_copy)] pub struct ClusterHistory { pub struct_version: u64, @@ -669,7 +666,6 @@ pub struct ClusterHistory { pub history: CircBufCluster, } -#[derive(AnchorSerialize)] #[zero_copy] pub struct ClusterHistoryEntry { pub total_blocks: u32, @@ -691,7 +687,6 @@ impl Default for ClusterHistoryEntry { } } -#[derive(AnchorSerialize)] #[zero_copy] pub struct CircBufCluster { pub idx: u64, diff --git a/utils/validator-history-cli/src/main.rs b/utils/validator-history-cli/src/main.rs index bf10a700..3d609fd9 100644 --- a/utils/validator-history-cli/src/main.rs +++ b/utils/validator-history-cli/src/main.rs @@ -564,7 +564,7 @@ fn command_backfill_cluster_history(args: BackfillClusterHistory, client: RpcCli accounts: validator_history::accounts::BackfillTotalBlocks { cluster_history_account: cluster_history_pda, config, - signer: keypair.pubkey(), + oracle_authority: keypair.pubkey(), } .to_account_metas(None), data: validator_history::instruction::BackfillTotalBlocks { From d339a0f89651e0a52469b5ebf42bb8c44eb08fd8 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Wed, 1 May 2024 18:59:15 -0400 Subject: [PATCH 05/11] accidentally removed --- programs/validator-history/src/state.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/programs/validator-history/src/state.rs b/programs/validator-history/src/state.rs index 8c05e218..4b8c1322 100644 --- a/programs/validator-history/src/state.rs +++ b/programs/validator-history/src/state.rs @@ -37,7 +37,7 @@ impl Config { static_assertions::const_assert_eq!(size_of::(), 128); -#[derive(TypeLayout)] +#[derive(AnchorSerialize, TypeLayout)] #[zero_copy] pub struct ValidatorHistoryEntry { pub activated_stake_lamports: u64, @@ -103,6 +103,7 @@ pub struct ClientVersion { const MAX_ITEMS: usize = 512; +#[derive(AnchorSerialize)] #[zero_copy] pub struct CircBuf { pub idx: u64, @@ -269,6 +270,7 @@ pub enum ValidatorHistoryVersion { static_assertions::const_assert_eq!(size_of::(), 65848); +#[derive(AnchorSerialize)] #[account(zero_copy)] pub struct ValidatorHistory { // Cannot be enum due to Pod and Zeroable trait limitations @@ -656,6 +658,7 @@ impl ValidatorHistory { } } +#[derive(AnchorSerialize)] #[account(zero_copy)] pub struct ClusterHistory { pub struct_version: u64, @@ -666,6 +669,7 @@ pub struct ClusterHistory { pub history: CircBufCluster, } +#[derive(AnchorSerialize)] #[zero_copy] pub struct ClusterHistoryEntry { pub total_blocks: u32, @@ -687,6 +691,7 @@ impl Default for ClusterHistoryEntry { } } +#[derive(AnchorSerialize)] #[zero_copy] pub struct CircBufCluster { pub idx: u64, From cb6df3214445e98740c519e715242caefadf124a Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Wed, 1 May 2024 19:23:30 -0400 Subject: [PATCH 06/11] insane anchor errors --- programs/validator-history/src/state.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/programs/validator-history/src/state.rs b/programs/validator-history/src/state.rs index 4b8c1322..cdee769e 100644 --- a/programs/validator-history/src/state.rs +++ b/programs/validator-history/src/state.rs @@ -37,7 +37,7 @@ impl Config { static_assertions::const_assert_eq!(size_of::(), 128); -#[derive(AnchorSerialize, TypeLayout)] +#[derive(BorshSerialize, TypeLayout)] #[zero_copy] pub struct ValidatorHistoryEntry { pub activated_stake_lamports: u64, @@ -103,7 +103,7 @@ pub struct ClientVersion { const MAX_ITEMS: usize = 512; -#[derive(AnchorSerialize)] +#[derive(BorshSerialize)] #[zero_copy] pub struct CircBuf { pub idx: u64, @@ -270,7 +270,7 @@ pub enum ValidatorHistoryVersion { static_assertions::const_assert_eq!(size_of::(), 65848); -#[derive(AnchorSerialize)] +#[derive(BorshSerialize)] #[account(zero_copy)] pub struct ValidatorHistory { // Cannot be enum due to Pod and Zeroable trait limitations @@ -658,7 +658,7 @@ impl ValidatorHistory { } } -#[derive(AnchorSerialize)] +#[derive(BorshSerialize)] #[account(zero_copy)] pub struct ClusterHistory { pub struct_version: u64, @@ -669,7 +669,7 @@ pub struct ClusterHistory { pub history: CircBufCluster, } -#[derive(AnchorSerialize)] +#[derive(BorshSerialize)] #[zero_copy] pub struct ClusterHistoryEntry { pub total_blocks: u32, @@ -691,7 +691,7 @@ impl Default for ClusterHistoryEntry { } } -#[derive(AnchorSerialize)] +#[derive(BorshSerialize)] #[zero_copy] pub struct CircBufCluster { pub idx: u64, From fddd4403ace33c402f6b482f7a037feece32edb2 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Thu, 9 May 2024 23:40:08 -0400 Subject: [PATCH 07/11] Some progress, not ready yet --- .github/workflows/build.yaml | 16 ++++++++-------- Cargo.toml | 3 +-- keepers/validator-keeper/Cargo.toml | 2 +- keepers/validator-keeper/src/gossip.rs | 11 ++++++++--- keepers/validator-keeper/src/lib.rs | 7 ++----- keepers/validator-keeper/src/mev_commission.rs | 4 ++-- keepers/validator-keeper/src/stake.rs | 5 ++--- keepers/validator-keeper/src/vote_account.rs | 3 +-- programs/validator-history/Cargo.toml | 1 - programs/validator-history/src/constants.rs | 2 +- .../src/instructions/backfill_total_blocks.rs | 6 +++++- .../copy_tip_distribution_account.rs | 2 +- programs/validator-history/src/lib.rs | 1 - 13 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 19e67cd6..631ff9d1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -33,14 +33,14 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: components: rustfmt, clippy - toolchain: nightly-2023-10-05 + toolchain: nightly-2024-02-04 - name: Install cargo-sort from crates.io uses: baptiste0928/cargo-install@v3 with: crate: cargo-sort - - run: cargo +nightly-2023-10-05 sort --workspace --check - - run: cargo +nightly-2023-10-05 fmt --all --check - - run: cargo +nightly-2023-10-05 clippy --all-features --all-targets --tests -- -D warnings + - run: cargo +nightly-2024-02-04 sort --workspace --check + - run: cargo +nightly-2024-02-04 fmt --all --check + - run: cargo +nightly-2024-02-04 clippy --all-features --all-targets --tests -- -D warnings udeps: name: udeps @@ -51,12 +51,12 @@ jobs: submodules: recursive - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2023-10-05 + toolchain: nightly-2024-02-04 - name: Install cargo-udeps from crates.io uses: baptiste0928/cargo-install@v3 with: crate: cargo-udeps - - run: cargo +nightly-2023-10-05 udeps --all-features --all-targets --tests + - run: cargo +nightly-2024-02-04 udeps --all-features --all-targets --tests verified_build: name: verified_build @@ -74,9 +74,9 @@ jobs: uses: baptiste0928/cargo-install@v3 with: crate: anchor-cli - version: "0.29.0" + version: "0.30.0" - name: install solana toolsuite - run: sh -c "$(curl -sSfL https://release.solana.com/v1.16.20/install)" + run: sh -c "$(curl -sSfL https://release.solana.com/v1.18.11/install)" - name: add to path run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH diff --git a/Cargo.toml b/Cargo.toml index 706e2ee6..ec092d75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,5 @@ members = [ "utils/*" ] - [profile.release] -overflow-checks = true \ No newline at end of file +overflow-checks = true diff --git a/keepers/validator-keeper/Cargo.toml b/keepers/validator-keeper/Cargo.toml index 33218b74..636858dc 100644 --- a/keepers/validator-keeper/Cargo.toml +++ b/keepers/validator-keeper/Cargo.toml @@ -11,8 +11,8 @@ clap = { version = "4.3.0", features = ["derive", "env"] } env_logger = "0.10.0" futures = "0.3.21" futures-util = "0.3.21" -keeper-core = { path = "../keeper-core" } jito-tip-distribution = { features = ["no-entrypoint"], git = "https://github.com/jito-foundation/jito-programs", rev = "50d450e993cb2278bcf97cd01b19e8a4f1f56e8e" } +keeper-core = { path = "../keeper-core" } log = "0.4.18" solana-account-decoder = "1.18" solana-clap-utils = "1.18" diff --git a/keepers/validator-keeper/src/gossip.rs b/keepers/validator-keeper/src/gossip.rs index 8ab78c8b..e3ce8c34 100644 --- a/keepers/validator-keeper/src/gossip.rs +++ b/keepers/validator-keeper/src/gossip.rs @@ -31,7 +31,7 @@ use tokio::time::sleep; use validator_history::{ self, constants::{MAX_ALLOC_BYTES, MIN_VOTE_EPOCHS}, - ValidatorHistory, Config, + Config, ValidatorHistory, }; use crate::{get_validator_history_accounts_with_retry, start_spy_server}; @@ -286,8 +286,13 @@ pub async fn upload_gossip_values( gossip_port, ); let exit: Arc = Arc::new(AtomicBool::new(false)); - let (_gossip_service, cluster_info) = - start_spy_server(entrypoint, gossip_port, spy_socket_addr, &keypair, exit.clone()); + let (_gossip_service, cluster_info) = start_spy_server( + entrypoint, + gossip_port, + spy_socket_addr, + &keypair, + exit.clone(), + ); let vote_accounts = get_vote_accounts_with_retry(&client, MIN_VOTE_EPOCHS, None).await?; let validator_history_accounts = diff --git a/keepers/validator-keeper/src/lib.rs b/keepers/validator-keeper/src/lib.rs index 8e345611..5bd6f484 100644 --- a/keepers/validator-keeper/src/lib.rs +++ b/keepers/validator-keeper/src/lib.rs @@ -3,10 +3,7 @@ use std::{ sync::{atomic::AtomicBool, Arc}, }; -use anchor_lang::{ - declare_program, prelude::borsh, AccountDeserialize, AnchorDeserialize, AnchorSerialize, - Discriminator, -}; +use anchor_lang::{AccountDeserialize, Discriminator}; use keeper_core::{ get_vote_accounts_with_retry, CreateUpdateStats, MultipleAccountsError, SubmitStats, TransactionExecutionError, @@ -31,11 +28,11 @@ use solana_sdk::{ }; use solana_streamer::socket::SocketAddrSpace; +use jito_tip_distribution::state::TipDistributionAccount; use thiserror::Error as ThisError; use validator_history::{ constants::MIN_VOTE_EPOCHS, ClusterHistory, ValidatorHistory, ValidatorHistoryEntry, }; -use jito_tip_distribution::state::TipDistributionAccount; pub mod cluster_info; pub mod gossip; diff --git a/keepers/validator-keeper/src/mev_commission.rs b/keepers/validator-keeper/src/mev_commission.rs index 98506738..2d058faf 100644 --- a/keepers/validator-keeper/src/mev_commission.rs +++ b/keepers/validator-keeper/src/mev_commission.rs @@ -1,6 +1,7 @@ use std::{collections::HashMap, str::FromStr, sync::Arc}; use anchor_lang::{AccountDeserialize, InstructionData, ToAccountMetas}; +use jito_tip_distribution::state::TipDistributionAccount; use keeper_core::{ build_create_and_update_instructions, get_multiple_accounts_batched, get_vote_accounts_with_retry, submit_create_and_update, Address, CreateTransaction, @@ -14,9 +15,8 @@ use solana_sdk::{signature::Keypair, signer::Signer}; use validator_history::{ constants::{MAX_ALLOC_BYTES, MIN_VOTE_EPOCHS}, utils::derive_tip_distribution_account_address, - ValidatorHistory, Config, + Config, ValidatorHistory, }; -use jito_tip_distribution::state::TipDistributionAccount; use crate::{KeeperError, PRIORITY_FEE}; diff --git a/keepers/validator-keeper/src/stake.rs b/keepers/validator-keeper/src/stake.rs index 638b2be5..5296b642 100644 --- a/keepers/validator-keeper/src/stake.rs +++ b/keepers/validator-keeper/src/stake.rs @@ -19,7 +19,7 @@ use solana_sdk::{ }; use validator_history::{ constants::{MAX_ALLOC_BYTES, MIN_VOTE_EPOCHS}, - state::{ValidatorHistory, Config}, + state::{Config, ValidatorHistory}, }; use crate::{KeeperError, PRIORITY_FEE}; @@ -55,8 +55,7 @@ impl StakeHistoryEntry { &[ValidatorHistory::SEED, &vote_pubkey.to_bytes()], program_id, ); - let (config_address, _) = - Pubkey::find_program_address(&[Config::SEED], program_id); + let (config_address, _) = Pubkey::find_program_address(&[Config::SEED], program_id); StakeHistoryEntry { stake: vote_account.activated_stake, diff --git a/keepers/validator-keeper/src/vote_account.rs b/keepers/validator-keeper/src/vote_account.rs index b9715ad3..5d06de41 100644 --- a/keepers/validator-keeper/src/vote_account.rs +++ b/keepers/validator-keeper/src/vote_account.rs @@ -34,8 +34,7 @@ impl CopyVoteAccountEntry { &[ValidatorHistory::SEED, &vote_account.to_bytes()], program_id, ); - let (config_address, _) = - Pubkey::find_program_address(&[Config::SEED], program_id); + let (config_address, _) = Pubkey::find_program_address(&[Config::SEED], program_id); Self { vote_account: *vote_account, validator_history_account, diff --git a/programs/validator-history/Cargo.toml b/programs/validator-history/Cargo.toml index 9ec05de6..12e85124 100644 --- a/programs/validator-history/Cargo.toml +++ b/programs/validator-history/Cargo.toml @@ -36,4 +36,3 @@ static_assertions = "1.1.0" thiserror = "1.0.37" type-layout = "0.2" validator-history-vote-state = { path = "../../utils/vote-state" } - diff --git a/programs/validator-history/src/constants.rs b/programs/validator-history/src/constants.rs index aa284863..5224cdf5 100644 --- a/programs/validator-history/src/constants.rs +++ b/programs/validator-history/src/constants.rs @@ -1,3 +1,3 @@ pub const MAX_ALLOC_BYTES: usize = 10240; pub const MIN_VOTE_EPOCHS: usize = 5; -pub const TIP_DISTRIBUTION_ACCOUNT_SEED: &'static [u8] = b"TIP_DISTRIBUTION_ACCOUNT"; +pub const TIP_DISTRIBUTION_ACCOUNT_SEED: &[u8] = b"TIP_DISTRIBUTION_ACCOUNT"; diff --git a/programs/validator-history/src/instructions/backfill_total_blocks.rs b/programs/validator-history/src/instructions/backfill_total_blocks.rs index b910e921..cd00a813 100644 --- a/programs/validator-history/src/instructions/backfill_total_blocks.rs +++ b/programs/validator-history/src/instructions/backfill_total_blocks.rs @@ -1,6 +1,10 @@ use anchor_lang::prelude::*; -use crate::{errors::ValidatorHistoryError, utils::cast_epoch, state::{ClusterHistory, Config}}; +use crate::{ + errors::ValidatorHistoryError, + state::{ClusterHistory, Config}, + utils::cast_epoch, +}; #[derive(Accounts)] pub struct BackfillTotalBlocks<'info> { diff --git a/programs/validator-history/src/instructions/copy_tip_distribution_account.rs b/programs/validator-history/src/instructions/copy_tip_distribution_account.rs index 7f96ae1d..be132ec0 100644 --- a/programs/validator-history/src/instructions/copy_tip_distribution_account.rs +++ b/programs/validator-history/src/instructions/copy_tip_distribution_account.rs @@ -35,7 +35,7 @@ pub struct CopyTipDistributionAccount<'info> { /// `owner = config.tip_distribution_program.key()` here is sufficient. #[account( seeds = [ - b"TIP_DISTRIBUTION_ACCOUNT", + TipDistributionAccount::SEED, vote_account.key().as_ref(), epoch.to_le_bytes().as_ref(), ], diff --git a/programs/validator-history/src/lib.rs b/programs/validator-history/src/lib.rs index affe33d5..d038794e 100644 --- a/programs/validator-history/src/lib.rs +++ b/programs/validator-history/src/lib.rs @@ -12,7 +12,6 @@ pub mod utils; pub use instructions::*; pub use state::*; - cfg_if::cfg_if! { if #[cfg(feature = "mainnet-beta")] { declare_id!("HistoryJTGbKQD2mRgLZ3XhqHnN811Qpez8X9kCcGHoa"); From 7bc7c287ddcc9a37d5e5c21dce47f343bebdac9e Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Mon, 20 May 2024 09:20:02 -0400 Subject: [PATCH 08/11] don't rm jito-programs --- .../validator-keeper/src/mev_commission.rs | 2 +- programs/validator-history/src/constants.rs | 1 - programs/validator-history/src/utils.rs | 19 ++----------------- tests/Cargo.toml | 1 + tests/src/fixtures.rs | 10 +++++----- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/keepers/validator-keeper/src/mev_commission.rs b/keepers/validator-keeper/src/mev_commission.rs index 2d058faf..84b87179 100644 --- a/keepers/validator-keeper/src/mev_commission.rs +++ b/keepers/validator-keeper/src/mev_commission.rs @@ -1,6 +1,7 @@ use std::{collections::HashMap, str::FromStr, sync::Arc}; use anchor_lang::{AccountDeserialize, InstructionData, ToAccountMetas}; +use jito_tip_distribution::sdk::derive_tip_distribution_account_address; use jito_tip_distribution::state::TipDistributionAccount; use keeper_core::{ build_create_and_update_instructions, get_multiple_accounts_batched, @@ -14,7 +15,6 @@ use solana_program::{instruction::Instruction, pubkey::Pubkey}; use solana_sdk::{signature::Keypair, signer::Signer}; use validator_history::{ constants::{MAX_ALLOC_BYTES, MIN_VOTE_EPOCHS}, - utils::derive_tip_distribution_account_address, Config, ValidatorHistory, }; diff --git a/programs/validator-history/src/constants.rs b/programs/validator-history/src/constants.rs index 5224cdf5..990e9342 100644 --- a/programs/validator-history/src/constants.rs +++ b/programs/validator-history/src/constants.rs @@ -1,3 +1,2 @@ pub const MAX_ALLOC_BYTES: usize = 10240; pub const MIN_VOTE_EPOCHS: usize = 5; -pub const TIP_DISTRIBUTION_ACCOUNT_SEED: &[u8] = b"TIP_DISTRIBUTION_ACCOUNT"; diff --git a/programs/validator-history/src/utils.rs b/programs/validator-history/src/utils.rs index 64c5fe12..13c44da1 100644 --- a/programs/validator-history/src/utils.rs +++ b/programs/validator-history/src/utils.rs @@ -1,10 +1,10 @@ use anchor_lang::{ prelude::{AccountInfo, Pubkey, Result}, require, - solana_program::{clock::Epoch, native_token::lamports_to_sol}, + solana_program::native_token::lamports_to_sol, }; -use crate::{constants::TIP_DISTRIBUTION_ACCOUNT_SEED, errors::ValidatorHistoryError}; +use crate::errors::ValidatorHistoryError; pub fn cast_epoch(epoch: u64) -> Result { require!( @@ -36,21 +36,6 @@ pub fn get_vote_account(validator_history_account_info: &AccountInfo) -> Pubkey Pubkey::from(data) } -pub fn derive_tip_distribution_account_address( - tip_distribution_program_id: &Pubkey, - vote_pubkey: &Pubkey, - epoch: Epoch, -) -> (Pubkey, u8) { - Pubkey::find_program_address( - &[ - TIP_DISTRIBUTION_ACCOUNT_SEED, - vote_pubkey.to_bytes().as_ref(), - epoch.to_le_bytes().as_ref(), - ], - tip_distribution_program_id, - ) -} - #[cfg(test)] mod tests { use super::*; diff --git a/tests/Cargo.toml b/tests/Cargo.toml index e68f72dc..39e7d2e7 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -14,6 +14,7 @@ bytemuck = { version = "1.13.1", features = ["derive", "min_const_generics"] } cfg-if = "1.0.0" ed25519-dalek = "1.0.1" futures = "0.3.25" +jito-tip-distribution = { features = ["no-entrypoint"], git = "https://github.com/jito-foundation/jito-programs", rev = "50d450e993cb2278bcf97cd01b19e8a4f1f56e8e" } matches = "0.1.10" rand = "0.7.3" semver = "1.0.17" diff --git a/tests/src/fixtures.rs b/tests/src/fixtures.rs index 500b9c64..3c5e2c8f 100644 --- a/tests/src/fixtures.rs +++ b/tests/src/fixtures.rs @@ -8,10 +8,10 @@ use { }, AccountSerialize, InstructionData, ToAccountMetas, }, - // jito_tip_distribution::{ - // sdk::derive_tip_distribution_account_address, - // state::{MerkleRoot, TipDistributionAccount}, - // }, + jito_tip_distribution::{ + sdk::derive_tip_distribution_account_address, + state::{MerkleRoot, TipDistributionAccount}, + }, solana_program_test::*, solana_sdk::{ account::Account, epoch_schedule::EpochSchedule, instruction::Instruction, @@ -19,7 +19,7 @@ use { }, std::{cell::RefCell, rc::Rc}, validator_history::{ - self, constants::MAX_ALLOC_BYTES, utils::derive_tip_distribution_account_address, + self, constants::MAX_ALLOC_BYTES, ClusterHistory, ValidatorHistory, }, }; From a4a004290ab188eb831ff1df26ef1081be6fa276 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Mon, 20 May 2024 09:49:03 -0400 Subject: [PATCH 09/11] don't rm jito-programs --- Cargo.lock | 325 ++++++++++++++++++++++++++++++++++++- Cargo.toml | 2 +- tests/Cargo.toml | 1 + tests/src/fixtures.rs | 22 ++- tests/tests/test_gossip.rs | 19 +-- 5 files changed, 347 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec654f5b..aefa738a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1664,6 +1664,18 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "educe" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "either" version = "1.9.0" @@ -1705,6 +1717,19 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "enum-ordinalize" +version = "3.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" +dependencies = [ + "num-bigint 0.4.4", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "env_logger" version = "0.9.3" @@ -2046,7 +2071,7 @@ dependencies = [ "indexmap 2.2.2", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.10", "tracing", ] @@ -2725,6 +2750,12 @@ dependencies = [ "libc", ] +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + [[package]] name = "matchit" version = "0.7.3" @@ -3175,6 +3206,25 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", +] + [[package]] name = "os_str_bytes" version = "6.6.1" @@ -3862,7 +3912,7 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", - "tokio-util", + "tokio-util 0.7.10", "tower-service", "url", "wasm-bindgen", @@ -4262,6 +4312,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shell-words" version = "1.1.0" @@ -4459,6 +4518,54 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-banks-client" +version = "1.18.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1630817c0df2ca64afd07e850b2a439f55dab75850008c1f3d6378d55f43a43" +dependencies = [ + "borsh 1.4.0", + "futures", + "solana-banks-interface", + "solana-program", + "solana-sdk", + "tarpc", + "thiserror", + "tokio", + "tokio-serde", +] + +[[package]] +name = "solana-banks-interface" +version = "1.18.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c6eef1d6b792eb16b3a214916736f5e211ef7b2c3f6344ef753f5054d6b648d" +dependencies = [ + "serde", + "solana-sdk", + "tarpc", +] + +[[package]] +name = "solana-banks-server" +version = "1.18.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbc2173ccec80fa07f075d054461e678397fa7fd7c16d18fae16b2e9d3c57320" +dependencies = [ + "bincode", + "crossbeam-channel", + "futures", + "solana-accounts-db", + "solana-banks-interface", + "solana-client", + "solana-runtime", + "solana-sdk", + "solana-send-transaction-service", + "tarpc", + "tokio", + "tokio-serde", +] + [[package]] name = "solana-bloom" version = "1.18.11" @@ -5010,6 +5117,36 @@ dependencies = [ "thiserror", ] +[[package]] +name = "solana-program-test" +version = "1.18.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b6ea8515eb200c6ba4841f99e17bc3498ae7bc6e95ebb3aff8ffa73bac482c7" +dependencies = [ + "assert_matches", + "async-trait", + "base64 0.21.7", + "bincode", + "chrono-humanize", + "crossbeam-channel", + "log", + "serde", + "solana-accounts-db", + "solana-banks-client", + "solana-banks-interface", + "solana-banks-server", + "solana-bpf-loader-program", + "solana-logger", + "solana-program-runtime", + "solana-runtime", + "solana-sdk", + "solana-vote-program", + "solana_rbpf", + "test-case", + "thiserror", + "tokio", +] + [[package]] name = "solana-pubsub-client" version = "1.18.11" @@ -5303,6 +5440,22 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" +[[package]] +name = "solana-send-transaction-service" +version = "1.18.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86bad64f4584997089757bf463d7c21099789a4fc8e9e412988b192f7d501a6" +dependencies = [ + "crossbeam-channel", + "log", + "solana-client", + "solana-measure", + "solana-metrics", + "solana-runtime", + "solana-sdk", + "solana-tpu-client", +] + [[package]] name = "solana-stake-program" version = "1.18.11" @@ -5979,6 +6132,41 @@ dependencies = [ "xattr", ] +[[package]] +name = "tarpc" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38a012bed6fb9681d3bf71ffaa4f88f3b4b9ed3198cda6e4c8462d24d4bb80" +dependencies = [ + "anyhow", + "fnv", + "futures", + "humantime", + "opentelemetry", + "pin-project", + "rand 0.8.5", + "serde", + "static_assertions", + "tarpc-plugins", + "thiserror", + "tokio", + "tokio-serde", + "tokio-util 0.6.10", + "tracing", + "tracing-opentelemetry", +] + +[[package]] +name = "tarpc-plugins" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "tempfile" version = "3.10.0" @@ -6006,6 +6194,65 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +[[package]] +name = "test-case" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" +dependencies = [ + "test-case-macros", +] + +[[package]] +name = "test-case-core" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "test-case-macros" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "test-case-core", +] + +[[package]] +name = "tests" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "bincode", + "bv", + "bytemuck", + "cfg-if", + "ed25519-dalek", + "futures", + "jito-tip-distribution", + "matches", + "rand 0.7.3", + "rand_chacha 0.3.1", + "semver", + "serde", + "serde_derive", + "solana-gossip", + "solana-program-test", + "solana-sdk", + "solana-version", + "validator-history", + "validator-history-vote-state", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -6041,6 +6288,16 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "time" version = "0.3.34" @@ -6166,6 +6423,22 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-serde" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" +dependencies = [ + "bincode", + "bytes", + "educe", + "futures-core", + "futures-sink", + "pin-project", + "serde", + "serde_json", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -6192,6 +6465,21 @@ dependencies = [ "webpki-roots 0.25.4", ] +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "slab", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.10" @@ -6329,7 +6617,7 @@ dependencies = [ "rand 0.8.5", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.10", "tower-layer", "tower-service", "tracing", @@ -6377,6 +6665,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", ] [[package]] @@ -6618,6 +6931,12 @@ dependencies = [ "validator-history", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index ec092d75..d30a17ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ members = [ "keepers/*", "programs/*", - # "tests", + "tests", "utils/*" ] diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 39e7d2e7..93488b41 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -17,6 +17,7 @@ futures = "0.3.25" jito-tip-distribution = { features = ["no-entrypoint"], git = "https://github.com/jito-foundation/jito-programs", rev = "50d450e993cb2278bcf97cd01b19e8a4f1f56e8e" } matches = "0.1.10" rand = "0.7.3" +rand_chacha = "0.3.1" semver = "1.0.17" serde = "1.0.183" serde_derive = "1.0.183" diff --git a/tests/src/fixtures.rs b/tests/src/fixtures.rs index 3c5e2c8f..6b84e4f1 100644 --- a/tests/src/fixtures.rs +++ b/tests/src/fixtures.rs @@ -18,10 +18,7 @@ use { signature::Keypair, signer::Signer, transaction::Transaction, }, std::{cell::RefCell, rc::Rc}, - validator_history::{ - self, constants::MAX_ALLOC_BYTES, - ClusterHistory, ValidatorHistory, - }, + validator_history::{self, constants::MAX_ALLOC_BYTES, ClusterHistory, ValidatorHistory}, }; pub struct TestFixture { @@ -242,9 +239,13 @@ impl TestFixture { .get_sysvar() .await .expect("Failed getting clock"); - let epoch_schedule: EpochSchedule = self.ctx.borrow().genesis_config().epoch_schedule; let target_epoch = clock.epoch + num_epochs; - let target_slot = epoch_schedule.get_first_slot_in_epoch(target_epoch); + let target_slot = self + .ctx + .borrow() + .genesis_config() + .epoch_schedule + .get_first_slot_in_epoch(target_epoch); self.ctx .borrow_mut() @@ -261,9 +262,14 @@ impl TestFixture { .await .expect("Failed getting clock"); - let epoch_schedule: EpochSchedule = self.ctx.borrow().genesis_config().epoch_schedule; let target_epoch = clock.epoch + num_epochs; - let dif_slots = epoch_schedule.get_first_slot_in_epoch(target_epoch) - clock.slot; + let target_slot = self + .ctx + .borrow() + .genesis_config() + .epoch_schedule + .get_first_slot_in_epoch(target_epoch); + let dif_slots = target_slot - clock.slot; clock.epoch_start_timestamp += (dif_slots * ms_per_slot) as i64; clock.unix_timestamp += (dif_slots * ms_per_slot) as i64; diff --git a/tests/tests/test_gossip.rs b/tests/tests/test_gossip.rs index 78fb5be9..80fdd85d 100644 --- a/tests/tests/test_gossip.rs +++ b/tests/tests/test_gossip.rs @@ -4,7 +4,7 @@ use anchor_lang::{solana_program::instruction::Instruction, InstructionData, ToA use bincode::serialize; use bytemuck::bytes_of; use ed25519_dalek::Signer as Ed25519Signer; -use rand::thread_rng; +use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng}; use solana_gossip::{ contact_info::ContactInfo, crds_value::{CrdsData, NodeInstance, Version}, @@ -61,11 +61,10 @@ async fn test_copy_legacy_contact_info() { fixture.initialize_config().await; fixture.initialize_validator_history_account().await; + let mut rng = ChaCha20Rng::from_seed([0u8; 32]); // create legacycontactinfo as signed crdsdata struct - let mut legacy_contact_info = LegacyContactInfo::new_rand( - &mut rand::thread_rng(), - Some(fixture.identity_keypair.pubkey()), - ); + let mut legacy_contact_info = + LegacyContactInfo::new_rand(&mut rng, Some(fixture.identity_keypair.pubkey())); legacy_contact_info.set_wallclock(0); let crds_data = CrdsData::LegacyContactInfo(legacy_contact_info.clone()); let transaction = create_gossip_tx(&fixture, &crds_data); @@ -321,7 +320,8 @@ async fn test_gossip_wrong_message() { fixture.initialize_validator_history_account().await; // Not a crdsdata that we're expecting - let node_instance = NodeInstance::new(&mut thread_rng(), fixture.identity_keypair.pubkey(), 0); + let mut rng = ChaCha20Rng::from_seed([0u8; 32]); + let node_instance = NodeInstance::new(&mut rng, fixture.identity_keypair.pubkey(), 0); let crds_data = CrdsData::NodeInstance(node_instance); let transaction = create_gossip_tx(&fixture, &crds_data); @@ -372,11 +372,10 @@ async fn test_gossip_timestamps() { assert!(account.last_ip_timestamp == wallclock + 1); assert!(account.last_version_timestamp == wallclock + 1); + let mut rng = ChaCha20Rng::from_seed([0u8; 32]); // LegacyContactInfo with old wallclock - let mut legacy_contact_info = LegacyContactInfo::new_rand( - &mut rand::thread_rng(), - Some(fixture.identity_keypair.pubkey()), - ); + let mut legacy_contact_info = + LegacyContactInfo::new_rand(&mut rng, Some(fixture.identity_keypair.pubkey())); legacy_contact_info.set_wallclock(wallclock); let crds_data = CrdsData::LegacyContactInfo(legacy_contact_info); From 13837a7772ffaf36392f23861b828f4d306a8925 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Mon, 20 May 2024 09:53:14 -0400 Subject: [PATCH 10/11] Rm idl --- idls/jito_tip_distribution.json | 750 -------------------------------- 1 file changed, 750 deletions(-) delete mode 100644 idls/jito_tip_distribution.json diff --git a/idls/jito_tip_distribution.json b/idls/jito_tip_distribution.json deleted file mode 100644 index 0b8b397a..00000000 --- a/idls/jito_tip_distribution.json +++ /dev/null @@ -1,750 +0,0 @@ -{ - "address": "4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7", - "metadata": { - "name": "jito_tip_distribution", - "version": "0.1.5", - "spec": "0.1.0", - "description": "Tip distribution program, responsible for distributing funds to entitled parties." - }, - "instructions": [ - { - "name": "claim", - "docs": ["Claims tokens from the [TipDistributionAccount]."], - "discriminator": [62, 198, 214, 193, 213, 159, 108, 210], - "accounts": [ - { - "name": "config" - }, - { - "name": "tip_distribution_account", - "writable": true - }, - { - "name": "claim_status", - "docs": [ - "Status of the claim. Used to prevent the same party from claiming multiple times." - ], - "writable": true - }, - { - "name": "claimant", - "docs": ["Receiver of the funds."], - "writable": true - }, - { - "name": "payer", - "docs": ["Who is paying for the claim."], - "writable": true, - "signer": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "bump", - "type": "u8" - }, - { - "name": "amount", - "type": "u64" - }, - { - "name": "proof", - "type": { - "vec": { - "array": ["u8", 32] - } - } - } - ] - }, - { - "name": "close_claim_status", - "docs": [ - "Anyone can invoke this only after the [TipDistributionAccount] has expired.", - "This instruction will return any rent back to `claimant` and close the account" - ], - "discriminator": [163, 214, 191, 165, 245, 188, 17, 185], - "accounts": [ - { - "name": "config" - }, - { - "name": "claim_status", - "writable": true - }, - { - "name": "claim_status_payer", - "docs": ["Receiver of the funds."], - "writable": true - } - ], - "args": [] - }, - { - "name": "close_tip_distribution_account", - "docs": [ - "Anyone can invoke this only after the [TipDistributionAccount] has expired.", - "This instruction will send any unclaimed funds to the designated `expired_funds_account`", - "before closing and returning the rent exempt funds to the validator." - ], - "discriminator": [47, 136, 208, 190, 125, 243, 74, 227], - "accounts": [ - { - "name": "config" - }, - { - "name": "expired_funds_account", - "writable": true - }, - { - "name": "tip_distribution_account", - "writable": true - }, - { - "name": "validator_vote_account", - "writable": true - }, - { - "name": "signer", - "docs": ["Anyone can crank this instruction."], - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "_epoch", - "type": "u64" - } - ] - }, - { - "name": "initialize", - "docs": ["Initialize a singleton instance of the [Config] account."], - "discriminator": [175, 175, 109, 31, 13, 152, 155, 237], - "accounts": [ - { - "name": "config", - "writable": true - }, - { - "name": "system_program" - }, - { - "name": "initializer", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "authority", - "type": "pubkey" - }, - { - "name": "expired_funds_account", - "type": "pubkey" - }, - { - "name": "num_epochs_valid", - "type": "u64" - }, - { - "name": "max_validator_commission_bps", - "type": "u16" - }, - { - "name": "bump", - "type": "u8" - } - ] - }, - { - "name": "initialize_tip_distribution_account", - "docs": [ - "Initialize a new [TipDistributionAccount] associated with the given validator vote key", - "and current epoch." - ], - "discriminator": [120, 191, 25, 182, 111, 49, 179, 55], - "accounts": [ - { - "name": "config" - }, - { - "name": "tip_distribution_account", - "writable": true - }, - { - "name": "validator_vote_account", - "docs": [ - "The validator's vote account is used to check this transaction's signer is also the authorized withdrawer." - ] - }, - { - "name": "signer", - "docs": [ - "Must be equal to the supplied validator vote account's authorized withdrawer." - ], - "writable": true, - "signer": true - }, - { - "name": "system_program" - } - ], - "args": [ - { - "name": "merkle_root_upload_authority", - "type": "pubkey" - }, - { - "name": "validator_commission_bps", - "type": "u16" - }, - { - "name": "bump", - "type": "u8" - } - ] - }, - { - "name": "update_config", - "docs": [ - "Update config fields. Only the [Config] authority can invoke this." - ], - "discriminator": [29, 158, 252, 191, 10, 83, 219, 99], - "accounts": [ - { - "name": "config", - "writable": true - }, - { - "name": "authority", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "new_config", - "type": { - "defined": { - "name": "Config" - } - } - } - ] - }, - { - "name": "upload_merkle_root", - "docs": [ - "Uploads a merkle root to the provided [TipDistributionAccount]. This instruction may be", - "invoked many times as long as the account is at least one epoch old and not expired; and", - "no funds have already been claimed. Only the `merkle_root_upload_authority` has the", - "authority to invoke." - ], - "discriminator": [70, 3, 110, 29, 199, 190, 205, 176], - "accounts": [ - { - "name": "config" - }, - { - "name": "tip_distribution_account", - "writable": true - }, - { - "name": "merkle_root_upload_authority", - "writable": true, - "signer": true - } - ], - "args": [ - { - "name": "root", - "type": { - "array": ["u8", 32] - } - }, - { - "name": "max_total_claim", - "type": "u64" - }, - { - "name": "max_num_nodes", - "type": "u64" - } - ] - } - ], - "accounts": [ - { - "name": "ClaimStatus", - "discriminator": [22, 183, 249, 157, 247, 95, 150, 96] - }, - { - "name": "Config", - "discriminator": [155, 12, 170, 224, 30, 250, 204, 130] - }, - { - "name": "TipDistributionAccount", - "discriminator": [85, 64, 113, 198, 234, 94, 120, 123] - } - ], - "events": [ - { - "name": "ClaimStatusClosedEvent", - "discriminator": [188, 143, 237, 229, 192, 182, 164, 118] - }, - { - "name": "ClaimedEvent", - "discriminator": [144, 172, 209, 86, 144, 87, 84, 115] - }, - { - "name": "ConfigUpdatedEvent", - "discriminator": [245, 158, 129, 99, 60, 100, 214, 220] - }, - { - "name": "MerkleRootUploadAuthorityUpdatedEvent", - "discriminator": [83, 157, 58, 165, 200, 171, 8, 106] - }, - { - "name": "MerkleRootUploadedEvent", - "discriminator": [94, 233, 236, 49, 52, 224, 181, 167] - }, - { - "name": "TipDistributionAccountClosedEvent", - "discriminator": [246, 152, 49, 154, 9, 79, 25, 58] - }, - { - "name": "TipDistributionAccountInitializedEvent", - "discriminator": [39, 165, 224, 61, 40, 140, 139, 255] - }, - { - "name": "ValidatorCommissionBpsUpdatedEvent", - "discriminator": [4, 34, 92, 25, 228, 88, 51, 206] - } - ], - "errors": [ - { - "code": 6000, - "name": "AccountValidationFailure", - "msg": "Account failed validation." - }, - { - "code": 6001, - "name": "ArithmeticError", - "msg": "Encountered an arithmetic under/overflow error." - }, - { - "code": 6002, - "name": "ExceedsMaxClaim", - "msg": "The maximum number of funds to be claimed has been exceeded." - }, - { - "code": 6003, - "name": "ExceedsMaxNumNodes", - "msg": "The maximum number of claims has been exceeded." - }, - { - "code": 6004, - "name": "ExpiredTipDistributionAccount", - "msg": "The given TipDistributionAccount has expired." - }, - { - "code": 6005, - "name": "FundsAlreadyClaimed", - "msg": "The funds for the given index and TipDistributionAccount have already been claimed." - }, - { - "code": 6006, - "name": "InvalidParameters", - "msg": "Supplied invalid parameters." - }, - { - "code": 6007, - "name": "InvalidProof", - "msg": "The given proof is invalid." - }, - { - "code": 6008, - "name": "InvalidVoteAccountData", - "msg": "Failed to deserialize the supplied vote account data." - }, - { - "code": 6009, - "name": "MaxValidatorCommissionFeeBpsExceeded", - "msg": "Validator's commission basis points must be less than or equal to the Config account's max_validator_commission_bps." - }, - { - "code": 6010, - "name": "PrematureCloseTipDistributionAccount", - "msg": "The given TipDistributionAccount is not ready to be closed." - }, - { - "code": 6011, - "name": "PrematureCloseClaimStatus", - "msg": "The given ClaimStatus account is not ready to be closed." - }, - { - "code": 6012, - "name": "PrematureMerkleRootUpload", - "msg": "Must wait till at least one epoch after the tip distribution account was created to upload the merkle root." - }, - { - "code": 6013, - "name": "RootNotUploaded", - "msg": "No merkle root has been uploaded to the given TipDistributionAccount." - }, - { - "code": 6014, - "name": "Unauthorized", - "msg": "Unauthorized signer." - } - ], - "types": [ - { - "name": "ClaimStatus", - "docs": [ - "Gives us an audit trail of who and what was claimed; also enforces and only-once claim by any party." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "is_claimed", - "docs": ["If true, the tokens have been claimed."], - "type": "bool" - }, - { - "name": "claimant", - "docs": [ - "Authority that claimed the tokens. Allows for delegated rewards claiming." - ], - "type": "pubkey" - }, - { - "name": "claim_status_payer", - "docs": ["The payer who created the claim."], - "type": "pubkey" - }, - { - "name": "slot_claimed_at", - "docs": ["When the funds were claimed."], - "type": "u64" - }, - { - "name": "amount", - "docs": ["Amount of funds claimed."], - "type": "u64" - }, - { - "name": "expires_at", - "docs": [ - "The epoch (upto and including) that tip funds can be claimed.", - "Copied since TDA can be closed, need to track to avoid making multiple claims" - ], - "type": "u64" - }, - { - "name": "bump", - "docs": ["The bump used to generate this account"], - "type": "u8" - } - ] - } - }, - { - "name": "ClaimStatusClosedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "claim_status_payer", - "docs": ["Account where funds were transferred to."], - "type": "pubkey" - }, - { - "name": "claim_status_account", - "docs": ["[ClaimStatus] account that was closed."], - "type": "pubkey" - } - ] - } - }, - { - "name": "ClaimedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "tip_distribution_account", - "docs": ["[TipDistributionAccount] claimed from."], - "type": "pubkey" - }, - { - "name": "payer", - "docs": [ - "User that paid for the claim, may or may not be the same as claimant." - ], - "type": "pubkey" - }, - { - "name": "claimant", - "docs": ["Account that received the funds."], - "type": "pubkey" - }, - { - "name": "amount", - "docs": ["Amount of funds to distribute."], - "type": "u64" - } - ] - } - }, - { - "name": "Config", - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "docs": ["Account with authority over this PDA."], - "type": "pubkey" - }, - { - "name": "expired_funds_account", - "docs": [ - "We want to expire funds after some time so that validators can be refunded the rent.", - "Expired funds will get transferred to this account." - ], - "type": "pubkey" - }, - { - "name": "num_epochs_valid", - "docs": [ - "Specifies the number of epochs a merkle root is valid for before expiring." - ], - "type": "u64" - }, - { - "name": "max_validator_commission_bps", - "docs": [ - "The maximum commission a validator can set on their distribution account." - ], - "type": "u16" - }, - { - "name": "bump", - "docs": ["The bump used to generate this account"], - "type": "u8" - } - ] - } - }, - { - "name": "ConfigUpdatedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "docs": ["Who updated it."], - "type": "pubkey" - } - ] - } - }, - { - "name": "MerkleRoot", - "type": { - "kind": "struct", - "fields": [ - { - "name": "root", - "docs": ["The 256-bit merkle root."], - "type": { - "array": ["u8", 32] - } - }, - { - "name": "max_total_claim", - "docs": [ - "Maximum number of funds that can ever be claimed from this [MerkleRoot]." - ], - "type": "u64" - }, - { - "name": "max_num_nodes", - "docs": [ - "Maximum number of nodes that can ever be claimed from this [MerkleRoot]." - ], - "type": "u64" - }, - { - "name": "total_funds_claimed", - "docs": ["Total funds that have been claimed."], - "type": "u64" - }, - { - "name": "num_nodes_claimed", - "docs": ["Number of nodes that have been claimed."], - "type": "u64" - } - ] - } - }, - { - "name": "MerkleRootUploadAuthorityUpdatedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "old_authority", - "type": "pubkey" - }, - { - "name": "new_authority", - "type": "pubkey" - } - ] - } - }, - { - "name": "MerkleRootUploadedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "merkle_root_upload_authority", - "docs": ["Who uploaded the root."], - "type": "pubkey" - }, - { - "name": "tip_distribution_account", - "docs": ["Where the root was uploaded to."], - "type": "pubkey" - } - ] - } - }, - { - "name": "TipDistributionAccount", - "docs": [ - "The account that validators register as **tip_receiver** with the tip-payment program." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "validator_vote_account", - "docs": [ - "The validator's vote account, also the recipient of remaining lamports after", - "upon closing this account." - ], - "type": "pubkey" - }, - { - "name": "merkle_root_upload_authority", - "docs": [ - "The only account authorized to upload a merkle-root for this account." - ], - "type": "pubkey" - }, - { - "name": "merkle_root", - "docs": [ - "The merkle root used to verify user claims from this account." - ], - "type": { - "option": { - "defined": { - "name": "MerkleRoot" - } - } - } - }, - { - "name": "epoch_created_at", - "docs": ["Epoch for which this account was created."], - "type": "u64" - }, - { - "name": "validator_commission_bps", - "docs": ["The commission basis points this validator charges."], - "type": "u16" - }, - { - "name": "expires_at", - "docs": [ - "The epoch (upto and including) that tip funds can be claimed." - ], - "type": "u64" - }, - { - "name": "bump", - "docs": ["The bump used to generate this account"], - "type": "u8" - } - ] - } - }, - { - "name": "TipDistributionAccountClosedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "expired_funds_account", - "docs": ["Account where unclaimed funds were transferred to."], - "type": "pubkey" - }, - { - "name": "tip_distribution_account", - "docs": ["[TipDistributionAccount] closed."], - "type": "pubkey" - }, - { - "name": "expired_amount", - "docs": ["Unclaimed amount transferred."], - "type": "u64" - } - ] - } - }, - { - "name": "TipDistributionAccountInitializedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "tip_distribution_account", - "type": "pubkey" - } - ] - } - }, - { - "name": "ValidatorCommissionBpsUpdatedEvent", - "type": { - "kind": "struct", - "fields": [ - { - "name": "tip_distribution_account", - "type": "pubkey" - }, - { - "name": "old_commission_bps", - "type": "u16" - }, - { - "name": "new_commission_bps", - "type": "u16" - } - ] - } - } - ] -} From 7e5684587024229a365ef6be7f88631a482253f1 Mon Sep 17 00:00:00 2001 From: Evan Batsell Date: Mon, 20 May 2024 10:14:55 -0400 Subject: [PATCH 11/11] Lint --- tests/src/fixtures.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/fixtures.rs b/tests/src/fixtures.rs index 6b84e4f1..9aea9969 100644 --- a/tests/src/fixtures.rs +++ b/tests/src/fixtures.rs @@ -14,8 +14,8 @@ use { }, solana_program_test::*, solana_sdk::{ - account::Account, epoch_schedule::EpochSchedule, instruction::Instruction, - signature::Keypair, signer::Signer, transaction::Transaction, + account::Account, instruction::Instruction, signature::Keypair, signer::Signer, + transaction::Transaction, }, std::{cell::RefCell, rc::Rc}, validator_history::{self, constants::MAX_ALLOC_BYTES, ClusterHistory, ValidatorHistory},