Skip to content

Commit 851e0b8

Browse files
authored
For newer version of committor program change its id (#530)
We want old running validators still use an old version of the program. Instead of replacing and old version with new one and breaking commits of old nodes we just deploy a new version separately at new address. <!-- greptile_comment --> ## Greptile Summary Updated On: 2025-09-05 08:52:37 UTC This PR implements a strategic migration of the MagicBlock committor program by changing its program ID from `CoMtrr6j336NSB5PAoAWpLe5hPgkcShWKbPgHhZxaxh` to `ComtrB2KEaWgXsW1dhr1xYL4Ht4Bjj3gXnnL6KMdABq`. This change is coordinated across the entire codebase to ensure consistency. The core change occurs in `magicblock-committor-program/src/lib.rs` where the `declare_id!` macro is updated to use the new program ID. This declaration is fundamental as it defines the program's on-chain identity and affects how Program Derived Addresses (PDAs) are calculated and how the program interacts with the Solana runtime. The migration strategy involves deploying a completely new version of the committor program at a different address rather than upgrading the existing program in-place. This approach allows old validators to continue operating with the previous program version while new deployments use the updated version. The change cascades through multiple configuration files: - Test integration configs (`schedulecommit-conf.devnet.toml`, `config-conf.devnet.toml`, `committor-conf.devnet.toml`) - Shell scripts (`run-test-validator.sh`) - Test documentation (`01_commits.rs`) - Compiled program binary (removed old binary) This coordinated update ensures that all components of the system reference the same new program ID, maintaining consistency between the program's declared identity and how it's referenced in configuration and test files. The approach fits well with Solana's program deployment model where program IDs are immutable once deployed, making side-by-side deployment the preferred method for major updates. ## Confidence score: 4/5 - This PR implements a well-thought-out migration strategy with minimal risk of breaking existing functionality - Score reflects the coordinated nature of changes across multiple files and the strategic approach to maintain backward compatibility - The program ID change requires careful attention during deployment to ensure the new program is properly deployed at the specified address <!-- /greptile_comment -->
1 parent a6a0503 commit 851e0b8

File tree

7 files changed

+6
-6
lines changed

7 files changed

+6
-6
lines changed
-124 KB
Binary file not shown.

magicblock-committor-program/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ pub use state::{
2424
#[cfg(not(feature = "no-entrypoint"))]
2525
solana_program::entrypoint!(process);
2626

27-
declare_id!("CoMtrr6j336NSB5PAoAWpLe5hPgkcShWKbPgHhZxaxh");
27+
declare_id!("ComtrB2KEaWgXsW1dhr1xYL4Ht4Bjj3gXnnL6KMdABq");

test-integration/configs/committor-conf.devnet.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ path = "../schedulecommit/elfs/dlp.so"
3434

3535
# NOTE: `cargo build-sbf` needs to run from the root to build the program
3636
[[program]]
37-
id = "CoMtrr6j336NSB5PAoAWpLe5hPgkcShWKbPgHhZxaxh"
37+
id = "ComtrB2KEaWgXsW1dhr1xYL4Ht4Bjj3gXnnL6KMdABq"
3838
path = "../../target/deploy/magicblock_committor_program.so"
3939

4040
[[program]]

test-integration/configs/config-conf.devnet.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ id = "DELeGGvXpWV2fqJUhqcF5ZSYMS4JTLjteaAMARRSaeSh"
3333
path = "../schedulecommit/elfs/dlp.so"
3434

3535
[[program]]
36-
id = "CoMtrr6j336NSB5PAoAWpLe5hPgkcShWKbPgHhZxaxh"
36+
id = "ComtrB2KEaWgXsW1dhr1xYL4Ht4Bjj3gXnnL6KMdABq"
3737
path = "../../target/deploy/magicblock_committor_program.so"
3838

3939
[[program]]

test-integration/configs/run-test-validator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ solana-test-validator \
1515
--limit-ledger-size \
1616
1000000 \
1717
--bpf-program \
18-
CoMtrr6j336NSB5PAoAWpLe5hPgkcShWKbPgHhZxaxh \
18+
ComtrB2KEaWgXsW1dhr1xYL4Ht4Bjj3gXnnL6KMdABq \
1919
$DIR/../../target/deploy/magicblock_committor_program.so \
2020
--bpf-program \
2121
f1exzKGtdeVX3d6UXZ89cY7twiNJe9S5uq84RTA4Rq4 \

test-integration/configs/schedulecommit-conf.devnet.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ path = "../schedulecommit/elfs/mdp.so"
3737

3838
# NOTE: `cargo build-sbf` needs to run from the root to build the program
3939
[[program]]
40-
id = "CoMtrr6j336NSB5PAoAWpLe5hPgkcShWKbPgHhZxaxh"
40+
id = "ComtrB2KEaWgXsW1dhr1xYL4Ht4Bjj3gXnnL6KMdABq"
4141
path = "../../target/deploy/magicblock_committor_program.so"
4242

4343
[[program]]

test-integration/schedulecommit/test-scenarios/tests/01_commits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod utils;
2323
// protocol fees vault: 7JrkjmZPprHwtuvtuGTXp9hwfGYFAQLnLeFM52kqAgXg
2424
// validator fees vault: DUH8h7rYjdTPYyBUEGAUwZv9ffz5wiM45GdYWYzogXjp
2525
// delegation program: DELeGGvXpWV2fqJUhqcF5ZSYMS4JTLjteaAMARRSaeSh
26-
// committor program: CoMtrr6j336NSB5PAoAWpLe5hPgkcShWKbPgHhZxaxh
26+
// committor program: ComtrB2KEaWgXsW1dhr1xYL4Ht4Bjj3gXnnL6KMdABq
2727

2828
#[test]
2929
fn test_committing_one_account() {

0 commit comments

Comments
 (0)