Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/consts.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use solana_program::pubkey;
use solana_program::pubkey::Pubkey;

/// The delegation session fees (extracted in percentage from the delegation PDAs rent on closure).
Expand All @@ -11,3 +12,7 @@ pub const EXTERNAL_UNDELEGATE_DISCRIMINATOR: [u8; 8] = [196, 28, 41, 206, 48, 37

/// The program ID of the delegation program.
pub const DELEGATION_PROGRAM_ID: Pubkey = crate::id();

/// Default validator identity (used when none is provided during delegation).
pub const DEFAULT_VALIDATOR_IDENTITY: Pubkey =
pubkey!("MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57");
3 changes: 2 additions & 1 deletion src/processor/delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use solana_program::{
};

use crate::args::DelegateArgs;
use crate::consts::DEFAULT_VALIDATOR_IDENTITY;
use crate::processor::utils::curve::is_on_curve;
use crate::processor::utils::loaders::{
load_owned_pda, load_pda, load_program, load_signer, load_uninitialized_pda,
Expand Down Expand Up @@ -133,7 +134,7 @@ pub fn process_delegate(
// Initialize the delegation record
let delegation_record = DelegationRecord {
owner: *owner_program.key,
authority: args.validator.unwrap_or(Pubkey::default()),
authority: args.validator.unwrap_or(DEFAULT_VALIDATOR_IDENTITY),
commit_frequency_ms: args.commit_frequency_ms as u64,
delegation_slot: solana_program::clock::Clock::get()?.slot,
lamports: delegated_account.lamports(),
Expand Down