Skip to content

Commit

Permalink
Feat: add tip router merkle root upload support (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjohn1028 authored Jan 17, 2025
1 parent b230b2b commit 5046a3c
Show file tree
Hide file tree
Showing 5 changed files with 754 additions and 115 deletions.
3 changes: 3 additions & 0 deletions mev-programs/programs/sdk/src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ pub struct ClaimArgs {
pub struct ClaimAccounts {
pub config: Pubkey,
pub tip_distribution_account: Pubkey,
pub merkle_root_upload_authority: Pubkey,
pub claim_status: Pubkey,
pub claimant: Pubkey,
pub payer: Pubkey,
Expand All @@ -264,6 +265,7 @@ pub fn claim_ix(program_id: Pubkey, args: ClaimArgs, accounts: ClaimAccounts) ->
let ClaimAccounts {
config,
tip_distribution_account,
merkle_root_upload_authority,
claim_status,
claimant,
payer,
Expand All @@ -281,6 +283,7 @@ pub fn claim_ix(program_id: Pubkey, args: ClaimArgs, accounts: ClaimAccounts) ->
accounts: jito_tip_distribution::accounts::Claim {
config,
tip_distribution_account,
merkle_root_upload_authority,
claimant,
claim_status,
payer,
Expand Down
162 changes: 162 additions & 0 deletions mev-programs/programs/tip-distribution/idl/jito_tip_distribution.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
"name": "tip_distribution_account",
"writable": true
},
{
"name": "merkle_root_upload_authority",
"signer": true
},
{
"name": "claim_status",
"docs": [
Expand Down Expand Up @@ -213,6 +217,51 @@
}
]
},
{
"name": "initialize_merkle_root_upload_config",
"discriminator": [
232,
87,
72,
14,
89,
40,
40,
27
],
"accounts": [
{
"name": "config",
"writable": true
},
{
"name": "merkle_root_upload_config",
"writable": true
},
{
"name": "authority",
"signer": true
},
{
"name": "payer",
"writable": true,
"signer": true
},
{
"name": "system_program"
}
],
"args": [
{
"name": "authority",
"type": "pubkey"
},
{
"name": "original_authority",
"type": "pubkey"
}
]
},
{
"name": "initialize_tip_distribution_account",
"docs": [
Expand Down Expand Up @@ -270,6 +319,29 @@
}
]
},
{
"name": "migrate_tda_merkle_root_upload_authority",
"discriminator": [
13,
226,
163,
144,
56,
202,
214,
23
],
"accounts": [
{
"name": "tip_distribution_account",
"writable": true
},
{
"name": "merkle_root_upload_config"
}
],
"args": []
},
{
"name": "update_config",
"docs": [
Expand Down Expand Up @@ -307,6 +379,45 @@
}
]
},
{
"name": "update_merkle_root_upload_config",
"discriminator": [
128,
227,
159,
139,
176,
128,
118,
2
],
"accounts": [
{
"name": "config"
},
{
"name": "merkle_root_upload_config",
"writable": true
},
{
"name": "authority",
"signer": true
},
{
"name": "system_program"
}
],
"args": [
{
"name": "authority",
"type": "pubkey"
},
{
"name": "original_authority",
"type": "pubkey"
}
]
},
{
"name": "upload_merkle_root",
"docs": [
Expand Down Expand Up @@ -387,6 +498,19 @@
130
]
},
{
"name": "MerkleRootUploadConfig",
"discriminator": [
213,
125,
30,
192,
25,
121,
87,
33
]
},
{
"name": "TipDistributionAccount",
"discriminator": [
Expand Down Expand Up @@ -582,6 +706,11 @@
"code": 6014,
"name": "Unauthorized",
"msg": "Unauthorized signer."
},
{
"code": 6015,
"name": "InvalidTdaForMigration",
"msg": "TDA not valid for migration."
}
],
"types": [
Expand Down Expand Up @@ -827,6 +956,39 @@
]
}
},
{
"name": "MerkleRootUploadConfig",
"docs": [
"Singleton account that allows overriding TDA's merkle upload authority"
],
"type": {
"kind": "struct",
"fields": [
{
"name": "override_authority",
"docs": [
"The authority that overrides the TipDistributionAccount merkle_root_upload_authority"
],
"type": "pubkey"
},
{
"name": "original_upload_authority",
"docs": [
"The original merkle root upload authority that can be changed to the new overrided",
"authority. E.g. Jito Labs authority GZctHpWXmsZC1YHACTGGcHhYxjdRqQvTpYkb9LMvxDib"
],
"type": "pubkey"
},
{
"name": "bump",
"docs": [
"The bump used to generate this account"
],
"type": "u8"
}
]
}
},
{
"name": "MerkleRootUploadedEvent",
"type": {
Expand Down
Loading

0 comments on commit 5046a3c

Please sign in to comment.