Skip to content

Commit

Permalink
[settlements-pipeline] adjusting pipeline wallets used for fee&rent (#57
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ochaloup committed May 23, 2024
1 parent 0f16945 commit 3b83407
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .buildkite/claim-settlements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ steps:
--rpc-url $$RPC_URL \
--settlement-json-files ./merkle-trees/* \
--operator-authority "$$VALIDATOR_BONDS_OPERATOR_AUTHORITY" \
--fee-payer "$$VALIDATOR_BONDS_RANDOM_TX_FEE_PAYER" \
--rent-payer "$$VALIDATOR_BONDS_RANDOM_RENT_PAYER" \
--fee-payer "$$VALIDATOR_BONDS_CLAIMING_WALLET" \
--rent-payer "$$VALIDATOR_BONDS_CLAIMING_WALLET" \
| tee ./claiming-report.txt
artifact_paths:
- "./claiming-report.txt"
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/close-settlements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ steps:
./target/release/close-settlement \
--rpc-url $$RPC_URL \
--operator-authority "$$VALIDATOR_BONDS_OPERATOR_AUTHORITY" \
--fee-payer "$$VALIDATOR_BONDS_FUNDING_WALLET" \
--fee-payer "$$VALIDATOR_BONDS_SETTLEMENTS_WALLET" \
--marinade-wallet "$$VALIDATOR_BONDS_FUNDING_WALLET" \
--past-settlements ./past-settlements.json | tee close-settlement-report.txt
artifact_paths:
Expand Down
5 changes: 3 additions & 2 deletions .buildkite/init-settlements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ steps:
--input-merkle-tree-collection "./settlement-merkle-trees.json" \
--input-settlement-collection "./settlements.json" \
--operator-authority "$$VALIDATOR_BONDS_OPERATOR_AUTHORITY" \
--fee-payer "$$VALIDATOR_BONDS_MARINADE_TX_FEE_PAYER" \
--rent-payer "$$VALIDATOR_BONDS_MARINADE_RENT_PAYER" \
--fee-payer "$$VALIDATOR_BONDS_SETTLEMENTS_WALLET" \
--rent-payer "$$VALIDATOR_BONDS_SETTLEMENTS_WALLET" \
--marinade-wallet "$$VALIDATOR_BONDS_FUNDING_WALLET" \
--epoch "$$epoch" || true)
- 'echo "$$report" | tee -a "./build-report.$$BUILDKITE_RETRY_COUNT"'
- '[ -n "$$result_code" ] && echo "init-settlement command FAILED" && exit $$result_code'
Expand Down
12 changes: 11 additions & 1 deletion settlement-pipelines/src/bin/init_settlement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ struct Args {
#[clap(flatten)]
tip_policy_opts: TipPolicyOpts,

/// Marinade wallet that pays for Marinade type Settlements
#[clap(long)]
marinade_wallet: Option<String>,

/// keypair payer for rent of accounts, if not provided, fee payer keypair is used
#[arg(long)]
rent_payer: Option<String>,
Expand Down Expand Up @@ -103,6 +107,11 @@ async fn main() -> anyhow::Result<()> {
} else {
fee_payer.clone()
};
let marinade_wallet = if let Some(marinade_wallet) = args.marinade_wallet.clone() {
load_keypair(&marinade_wallet)?
} else {
fee_payer.clone()
};

let config_address = args.global_opts.config;
info!(
Expand Down Expand Up @@ -520,6 +529,7 @@ async fn main() -> anyhow::Result<()> {
let mut transaction_builder = TransactionBuilder::limited(fee_payer.clone());
transaction_builder.add_signer_checked(&operator_authority.clone());
transaction_builder.add_signer_checked(&rent_keypair);
transaction_builder.add_signer_checked(&marinade_wallet);

// Funding settlements
let mut funded_settlements_overall = 0u32;
Expand All @@ -538,7 +548,7 @@ async fn main() -> anyhow::Result<()> {
new_stake_account_keypair.pubkey()
);
let instructions = create_stake_account(
&fee_payer.pubkey(),
&marinade_wallet.pubkey(),
&new_stake_account_keypair.pubkey(),
&Authorized {
withdrawer: withdrawer_authority,
Expand Down

0 comments on commit 3b83407

Please sign in to comment.