Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pr] Serialize structs for svm-rollup module #4

Merged
merged 3 commits into from
Jul 30, 2024
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
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions compute-budget/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ edition = { workspace = true }
[dependencies]
solana-frozen-abi = { workspace = true, optional = true }
solana-sdk = { workspace = true }
serde = { workspace = true }
serde_derive = { workspace = true }

[build-dependencies]
rustc_version = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion compute-budget/src/compute_budget.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::compute_budget_processor::{self, ComputeBudgetLimits, DEFAULT_HEAP_COST};
use serde::{Serialize, Deserialize};

#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))]
impl ::solana_frozen_abi::abi_example::AbiExample for ComputeBudget {
Expand All @@ -18,7 +19,7 @@ pub const MAX_CALL_DEPTH: usize = 64;
/// The size of one SBF stack frame.
pub const STACK_FRAME_SIZE: usize = 4096;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
pub struct ComputeBudget {
/// Number of compute units that a transaction or individual instruction is
/// allowed to consume. Compute units are consumed by program execution,
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/feature_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ lazy_static! {

/// `FeatureSet` holds the set of currently active/inactive runtime features
#[cfg_attr(feature = "frozen-abi", derive(AbiExample))]
#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
pub struct FeatureSet {
pub active: HashMap<Pubkey, Slot>,
pub inactive: HashSet<Pubkey>,
Expand Down
5 changes: 3 additions & 2 deletions sdk/src/fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use crate::native_token::sol_to_lamports;
#[cfg(not(target_os = "solana"))]
use solana_program::message::SanitizedMessage;
use serde::{Serialize, Deserialize};

/// A fee and its associated compute unit limit
#[derive(Debug, Default, Clone, Eq, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Default, Clone, Eq, PartialEq)]
pub struct FeeBin {
/// maximum compute units for which this fee will be charged
pub limit: u64,
Expand All @@ -21,7 +22,7 @@ pub struct FeeBudgetLimits {
}

/// Information used to calculate fees
#[derive(Debug, Clone, Eq, PartialEq)]
#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
pub struct FeeStructure {
/// lamports per signature
pub lamports_per_signature: u64,
Expand Down