Skip to content

Commit

Permalink
solana-ibc: use 10 KiB for initial size of PDAs
Browse files Browse the repository at this point in the history
Co-authored-by: Michał Nazarewicz <[email protected]>
  • Loading branch information
dhruvja and mina86 committed Nov 19, 2023
1 parent 3470d4f commit 7f4abfb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions solana/solana-ibc/programs/solana-ibc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ pub struct Chain<'info> {
sender: Signer<'info>,

/// The guest blockchain data.
#[account(init_if_needed, payer = sender, seeds = [CHAIN_SEED], bump, space = 10000)]
#[account(init_if_needed, payer = sender, seeds = [CHAIN_SEED], bump, space = 10240)]
chain: Account<'info, chain::ChainData>,

/// The account holding the trie which corresponds to guest blockchain’s
/// state root.
///
/// CHECK: Account’s owner is checked by [`storage::get_provable_from`]
/// function.
#[account(init_if_needed, payer = sender, seeds = [TRIE_SEED], bump, space = 1000)]
#[account(init_if_needed, payer = sender, seeds = [TRIE_SEED], bump, space = 10240)]
trie: UncheckedAccount<'info>,

system_program: Program<'info, System>,
Expand All @@ -185,15 +185,15 @@ pub struct ChainWithVerifier<'info> {
sender: Signer<'info>,

/// The guest blockchain data.
#[account(init_if_needed, payer = sender, seeds = [CHAIN_SEED], bump, space = 10000)]
#[account(init_if_needed, payer = sender, seeds = [CHAIN_SEED], bump, space = 10240)]
chain: Account<'info, chain::ChainData>,

/// The account holding the trie which corresponds to guest blockchain’s
/// state root.
///
/// CHECK: Account’s owner is checked by [`storage::get_provable_from`]
/// function.
#[account(init_if_needed, payer = sender, seeds = [TRIE_SEED], bump, space = 1000)]
#[account(init_if_needed, payer = sender, seeds = [TRIE_SEED], bump, space = 10240)]
trie: UncheckedAccount<'info>,

#[account(address = solana_program::sysvar::instructions::ID)]
Expand All @@ -209,22 +209,22 @@ pub struct Deliver<'info> {
sender: Signer<'info>,

/// The account holding private IBC storage.
#[account(init_if_needed, payer = sender, seeds = [SOLANA_IBC_STORAGE_SEED], bump, space = 10000)]
#[account(init_if_needed, payer = sender, seeds = [SOLANA_IBC_STORAGE_SEED], bump, space = 10240)]
storage: Account<'info, storage::PrivateStorage>,

/// The account holding provable IBC storage, i.e. the trie.
///
/// CHECK: Account’s owner is checked by [`storage::get_provable_from`]
/// function.
#[account(init_if_needed, payer = sender, seeds = [TRIE_SEED], bump, space = 1000)]
#[account(init_if_needed, payer = sender, seeds = [TRIE_SEED], bump, space = 10240)]
trie: UncheckedAccount<'info>,

/// The account holding packets.
#[account(init_if_needed, payer = sender, seeds = [PACKET_SEED], bump, space = 1000)]
#[account(init_if_needed, payer = sender, seeds = [PACKET_SEED], bump, space = 10240)]
packets: Account<'info, storage::IbcPackets>,

/// The guest blockchain data.
#[account(init_if_needed, payer = sender, seeds = [CHAIN_SEED], bump, space = 10000)]
#[account(init_if_needed, payer = sender, seeds = [CHAIN_SEED], bump, space = 10240)]
chain: Box<Account<'info, chain::ChainData>>,

system_program: Program<'info, System>,
Expand Down

0 comments on commit 7f4abfb

Please sign in to comment.