Delete deprecated interfaces (#119)

* delete deprecated interfaces

* bump version
This commit is contained in:
Hardhat Chad
2025-03-23 11:41:01 -05:00
committed by GitHub
parent 34b7de191c
commit 52b5dfd17e
12 changed files with 13 additions and 147 deletions

6
Cargo.lock generated
View File

@@ -1266,7 +1266,7 @@ dependencies = [
[[package]] [[package]]
name = "ore-api" name = "ore-api"
version = "3.2.0" version = "3.3.0"
dependencies = [ dependencies = [
"array-const-fn-init", "array-const-fn-init",
"bytemuck", "bytemuck",
@@ -1323,11 +1323,11 @@ dependencies = [
[[package]] [[package]]
name = "ore-program" name = "ore-program"
version = "3.2.0" version = "3.3.0"
dependencies = [ dependencies = [
"drillx", "drillx",
"mpl-token-metadata", "mpl-token-metadata",
"ore-api 3.2.0", "ore-api 3.3.0",
"ore-boost-api 3.0.0", "ore-boost-api 3.0.0",
"rand 0.8.5", "rand 0.8.5",
"solana-program", "solana-program",

View File

@@ -3,7 +3,7 @@ resolver = "2"
members = ["api", "program"] members = ["api", "program"]
[workspace.package] [workspace.package]
version = "3.2.0" version = "3.3.0"
edition = "2021" edition = "2021"
license = "Apache-2.0" license = "Apache-2.0"
homepage = "https://ore.supply" homepage = "https://ore.supply"

View File

@@ -131,10 +131,6 @@ pub const MINT_ADDRESS: Pubkey =
/// The bump of the mint account. /// The bump of the mint account.
pub const MINT_BUMP: u8 = ed25519::derive_program_address(&[MINT, &MINT_NOISE], &PROGRAM_ID).1; pub const MINT_BUMP: u8 = ed25519::derive_program_address(&[MINT, &MINT_NOISE], &PROGRAM_ID).1;
/// The address of the v1 mint account.
#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")]
pub const MINT_V1_ADDRESS: Pubkey = pubkey!("oreoN2tQbHXVaZsr3pf66A48miqcBXCDJozganhEJgz");
/// The address of the treasury account. /// The address of the treasury account.
pub const TREASURY_ADDRESS: Pubkey = pub const TREASURY_ADDRESS: Pubkey =
Pubkey::new_from_array(ed25519::derive_program_address(&[TREASURY], &PROGRAM_ID).0); Pubkey::new_from_array(ed25519::derive_program_address(&[TREASURY], &PROGRAM_ID).0);

View File

@@ -9,11 +9,7 @@ pub enum OreInstruction {
Mine = 2, Mine = 2,
Open = 3, Open = 3,
Reset = 4, Reset = 4,
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")] Update = 5,
Stake = 5,
Update = 6,
#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")]
Upgrade = 7,
// Admin // Admin
Initialize = 100, Initialize = 100,
@@ -38,68 +34,24 @@ pub struct Mine {
#[repr(C)] #[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)] #[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Open { pub struct Open {}
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bump: u8,
}
#[repr(C)] #[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)] #[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Reset {} pub struct Reset {}
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")]
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Stake {
pub amount: [u8; 8],
}
#[repr(C)] #[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)] #[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Update {} pub struct Update {}
#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")]
#[repr(C)] #[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)] #[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Upgrade { pub struct Initialize {}
pub amount: [u8; 8],
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Initialize {
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bus_0_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bus_1_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bus_2_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bus_3_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bus_4_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bus_5_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bus_6_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub bus_7_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub config_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub metadata_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub mint_bump: u8,
#[deprecated(since = "2.5.0", note = "Bump no longer used")]
pub treasury_bump: u8,
}
instruction!(OreInstruction, Claim); instruction!(OreInstruction, Claim);
instruction!(OreInstruction, Close); instruction!(OreInstruction, Close);
instruction!(OreInstruction, Mine); instruction!(OreInstruction, Mine);
instruction!(OreInstruction, Open); instruction!(OreInstruction, Open);
instruction!(OreInstruction, Reset); instruction!(OreInstruction, Reset);
instruction!(OreInstruction, Stake);
instruction!(OreInstruction, Update); instruction!(OreInstruction, Update);
instruction!(OreInstruction, Upgrade);
instruction!(OreInstruction, Initialize); instruction!(OreInstruction, Initialize);

View File

@@ -1,7 +1,6 @@
pub mod consts; pub mod consts;
pub mod error; pub mod error;
pub mod event; pub mod event;
#[allow(deprecated)]
pub mod instruction; pub mod instruction;
pub mod loaders; pub mod loaders;
pub mod sdk; pub mod sdk;

View File

@@ -84,7 +84,6 @@ pub fn mine(
} }
/// Builds an open instruction. /// Builds an open instruction.
#[allow(deprecated)]
pub fn open(signer: Pubkey, miner: Pubkey, payer: Pubkey) -> Instruction { pub fn open(signer: Pubkey, miner: Pubkey, payer: Pubkey) -> Instruction {
let proof_pda = proof_pda(signer); let proof_pda = proof_pda(signer);
Instruction { Instruction {
@@ -97,7 +96,7 @@ pub fn open(signer: Pubkey, miner: Pubkey, payer: Pubkey) -> Instruction {
AccountMeta::new_readonly(solana_program::system_program::ID, false), AccountMeta::new_readonly(solana_program::system_program::ID, false),
AccountMeta::new_readonly(sysvar::slot_hashes::ID, false), AccountMeta::new_readonly(sysvar::slot_hashes::ID, false),
], ],
data: Open { bump: proof_pda.1 }.to_bytes(), data: Open {}.to_bytes(),
} }
} }
@@ -125,27 +124,6 @@ pub fn reset(signer: Pubkey) -> Instruction {
} }
} }
/// Build a stake instruction.
#[allow(deprecated)]
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")]
pub fn stake(signer: Pubkey, sender: Pubkey, amount: u64) -> Instruction {
let proof = proof_pda(signer).0;
Instruction {
program_id: crate::ID,
accounts: vec![
AccountMeta::new(signer, true),
AccountMeta::new(proof, false),
AccountMeta::new(sender, false),
AccountMeta::new(TREASURY_TOKENS_ADDRESS, false),
AccountMeta::new_readonly(spl_token::ID, false),
],
data: Stake {
amount: amount.to_le_bytes(),
}
.to_bytes(),
}
}
// Build an update instruction. // Build an update instruction.
pub fn update(signer: Pubkey, miner: Pubkey) -> Instruction { pub fn update(signer: Pubkey, miner: Pubkey) -> Instruction {
let proof = proof_pda(signer).0; let proof = proof_pda(signer).0;
@@ -160,30 +138,7 @@ pub fn update(signer: Pubkey, miner: Pubkey) -> Instruction {
} }
} }
// Build an upgrade instruction.
#[allow(deprecated)]
#[deprecated(since = "2.6.0", note = "v1 tokens are no longer eligable to upgrade")]
pub fn upgrade(signer: Pubkey, beneficiary: Pubkey, sender: Pubkey, amount: u64) -> Instruction {
Instruction {
program_id: crate::ID,
accounts: vec![
AccountMeta::new(signer, true),
AccountMeta::new(beneficiary, false),
AccountMeta::new(MINT_ADDRESS, false),
AccountMeta::new(MINT_V1_ADDRESS, false),
AccountMeta::new(sender, false),
AccountMeta::new(TREASURY_ADDRESS, false),
AccountMeta::new_readonly(spl_token::ID, false),
],
data: Upgrade {
amount: amount.to_le_bytes(),
}
.to_bytes(),
}
}
/// Builds an initialize instruction. /// Builds an initialize instruction.
#[allow(deprecated)]
pub fn initialize(signer: Pubkey) -> Instruction { pub fn initialize(signer: Pubkey) -> Instruction {
let bus_pdas = [ let bus_pdas = [
bus_pda(0), bus_pda(0),
@@ -229,20 +184,6 @@ pub fn initialize(signer: Pubkey) -> Instruction {
AccountMeta::new_readonly(mpl_token_metadata::ID, false), AccountMeta::new_readonly(mpl_token_metadata::ID, false),
AccountMeta::new_readonly(sysvar::rent::ID, false), AccountMeta::new_readonly(sysvar::rent::ID, false),
], ],
data: Initialize { data: Initialize {}.to_bytes(),
bus_0_bump: bus_pdas[0].1,
bus_1_bump: bus_pdas[1].1,
bus_2_bump: bus_pdas[2].1,
bus_3_bump: bus_pdas[3].1,
bus_4_bump: bus_pdas[4].1,
bus_5_bump: bus_pdas[5].1,
bus_6_bump: bus_pdas[6].1,
bus_7_bump: bus_pdas[7].1,
config_bump: config_pda.1,
metadata_bump: metadata_pda.1,
mint_bump: mint_pda.1,
treasury_bump: treasury_pda.1,
}
.to_bytes(),
} }
} }

View File

@@ -15,9 +15,8 @@ pub struct Config {
/// The minimum accepted difficulty. /// The minimum accepted difficulty.
pub min_difficulty: u64, pub min_difficulty: u64,
/// The largest known stake balance on the network from the last epoch. /// Buffer for possible future use.
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")] pub _buffer: [u8; 8],
pub top_balance: u64,
} }
account!(OreAccount, Config); account!(OreAccount, Config);

View File

@@ -22,9 +22,8 @@ pub struct Proof {
/// The last time this account provided a hash. /// The last time this account provided a hash.
pub last_hash_at: i64, pub last_hash_at: i64,
/// The last time stake was deposited into this account. /// Buffer for possible future use.
#[deprecated(since = "2.4.0", note = "Please stake with the boost program")] pub _buffer: [u8; 8],
pub last_stake_at: i64,
/// The keypair which has permission to submit hashes for mining. /// The keypair which has permission to submit hashes for mining.
pub miner: Pubkey, pub miner: Pubkey,

View File

@@ -4,9 +4,7 @@ mod initialize;
mod mine; mod mine;
mod open; mod open;
mod reset; mod reset;
mod stake;
mod update; mod update;
mod upgrade;
use claim::*; use claim::*;
use close::*; use close::*;
@@ -14,14 +12,11 @@ use initialize::*;
use mine::*; use mine::*;
use open::*; use open::*;
use reset::*; use reset::*;
use stake::*;
use update::*; use update::*;
use upgrade::*;
use ore_api::instruction::*; use ore_api::instruction::*;
use steel::*; use steel::*;
#[allow(deprecated)]
pub fn process_instruction( pub fn process_instruction(
program_id: &Pubkey, program_id: &Pubkey,
accounts: &[AccountInfo], accounts: &[AccountInfo],
@@ -35,9 +30,7 @@ pub fn process_instruction(
OreInstruction::Mine => process_mine(accounts, data)?, OreInstruction::Mine => process_mine(accounts, data)?,
OreInstruction::Open => process_open(accounts, data)?, OreInstruction::Open => process_open(accounts, data)?,
OreInstruction::Reset => process_reset(accounts, data)?, OreInstruction::Reset => process_reset(accounts, data)?,
OreInstruction::Stake => process_stake(accounts, data)?,
OreInstruction::Update => process_update(accounts, data)?, OreInstruction::Update => process_update(accounts, data)?,
OreInstruction::Upgrade => process_upgrade(accounts, data)?,
OreInstruction::Initialize => process_initialize(accounts, data)?, OreInstruction::Initialize => process_initialize(accounts, data)?,
} }

View File

@@ -6,7 +6,6 @@ use ore_boost_api::{
consts::{DENOMINATOR_MULTIPLIER, ROTATION_DURATION}, consts::{DENOMINATOR_MULTIPLIER, ROTATION_DURATION},
state::{Boost, Config as BoostConfig}, state::{Boost, Config as BoostConfig},
}; };
#[allow(deprecated)]
use solana_program::{ use solana_program::{
keccak::hashv, keccak::hashv,
sanitize::SanitizeError, sanitize::SanitizeError,

View File

@@ -1,6 +0,0 @@
use steel::*;
/// Stake deposits ORE into a proof account to earn multiplier.
pub fn process_stake(_accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
panic!("This instruction has been deprecated. Please stake with the boost program instead.");
}

View File

@@ -1,6 +0,0 @@
use steel::*;
/// Upgrade allows a user to migrate a v1 token to a v2 token at a 1:1 exchange rate.
pub fn process_upgrade(_accounts: &[AccountInfo<'_>], _data: &[u8]) -> ProgramResult {
panic!("This instruction has been deprecated. v1 tokens are no longer eligable to upgrade.");
}