Przeglądaj źródła

lang: Dynamically fetch rent sysvar for when using `init` (#588)

Kirill Fomichev 4 lat temu
rodzic
commit
ceb80b0a04

+ 1 - 0
CHANGELOG.md

@@ -17,6 +17,7 @@ incremented for features.
 * cli: Adds the anchor login <api-token> command ([#570](https://github.com/project-serum/anchor/pull/570)).
 * cli: Adds the anchor publish <package> command ([#570](https://github.com/project-serum/anchor/pull/570)).
 * cli: Adds a root level anchor_version field to the Anchor.toml for specifying the cli version to build with for verifiable build ([#570](https://github.com/project-serum/anchor/pull/570)).
+* lang: Dynamically fetch rent sysvar for when using `init` ([#587](https://github.com/project-serum/anchor/pull/587)).
 
 ### Breaking
 

+ 47 - 0
Makefile

@@ -2,3 +2,50 @@
 build-cli:
 	cargo build -p anchor-cli --release
 	cp target/release/anchor cli/npm-package/anchor
+
+.PHONY: build-example-bpf-%
+build-example-bpf-%: export NAME=$(subst _,/,$($(strip @):build-example-bpf-%=%))
+build-example-bpf-%:
+	cd examples/${NAME} && cargo build-bpf
+
+.PHONY: build-example-bpf-permissioned-markets
+build-example-bpf-permissioned-markets:
+	cd examples/permissioned-markets/deps/serum-dex/dex && cargo build-bpf
+	cd examples/permissioned-markets && cargo build-bpf
+
+.PHONY: build-example-bpf-swap
+build-example-bpf-swap:
+	cd examples/swap/deps/serum-dex/dex && cargo build-bpf
+	cd examples/swap && cargo build-bpf
+
+.PHONY: build-example-bpf-all
+build-example-bpf-all: build-example-bpf-cashiers-check
+build-example-bpf-all: build-example-bpf-cfo
+build-example-bpf-all: build-example-bpf-chat
+build-example-bpf-all: build-example-bpf-composite
+build-example-bpf-all: build-example-bpf-errors
+build-example-bpf-all: build-example-bpf-escrow
+build-example-bpf-all: build-example-bpf-events
+build-example-bpf-all: build-example-bpf-ido-pool
+build-example-bpf-all: build-example-bpf-interface
+build-example-bpf-all: build-example-bpf-lockup
+build-example-bpf-all: build-example-bpf-misc
+build-example-bpf-all: build-example-bpf-multisig
+build-example-bpf-all: build-example-bpf-permissioned-markets
+build-example-bpf-all: build-example-bpf-pyth
+build-example-bpf-all: build-example-bpf-spl_token-proxy
+build-example-bpf-all: build-example-bpf-swap
+build-example-bpf-all: build-example-bpf-sysvars
+build-example-bpf-all: build-example-bpf-tutorial_basic-0
+build-example-bpf-all: build-example-bpf-tutorial_basic-1
+build-example-bpf-all: build-example-bpf-tutorial_basic-2
+build-example-bpf-all: build-example-bpf-tutorial_basic-3
+build-example-bpf-all: build-example-bpf-tutorial_basic-4
+build-example-bpf-all: build-example-bpf-tutorial_basic-5
+build-example-bpf-all: build-example-bpf-typescript
+build-example-bpf-all: build-example-bpf-zero-copy
+
+.PHONY: clean
+clean:
+	find . -type d -name .anchor -print0 | xargs -0 rm -rf
+	find . -type d -name target -print0 | xargs -0 rm -rf

+ 0 - 3
client/example/src/main.rs

@@ -3,7 +3,6 @@ use anchor_client::solana_sdk::pubkey::Pubkey;
 use anchor_client::solana_sdk::signature::read_keypair_file;
 use anchor_client::solana_sdk::signature::{Keypair, Signer};
 use anchor_client::solana_sdk::system_instruction;
-use anchor_client::solana_sdk::sysvar;
 use anchor_client::{Client, Cluster, EventContext};
 use anyhow::Result;
 // The `accounts` and `instructions` modules are generated by the framework.
@@ -96,7 +95,6 @@ fn composite(client: &Client, pid: Pubkey) -> Result<()> {
         .accounts(Initialize {
             dummy_a: dummy_a.pubkey(),
             dummy_b: dummy_b.pubkey(),
-            rent: sysvar::rent::ID,
         })
         .args(composite_instruction::Initialize)
         .send()?;
@@ -158,7 +156,6 @@ fn basic_2(client: &Client, pid: Pubkey) -> Result<()> {
         .signer(&counter)
         .accounts(basic_2_accounts::Create {
             counter: counter.pubkey(),
-            rent: sysvar::rent::ID,
         })
         .args(basic_2_instruction::Create { authority })
         .send()?;

+ 0 - 2
client/src/lib.rs

@@ -5,7 +5,6 @@ use anchor_lang::solana_program::instruction::{AccountMeta, Instruction};
 use anchor_lang::solana_program::program_error::ProgramError;
 use anchor_lang::solana_program::pubkey::Pubkey;
 use anchor_lang::solana_program::system_program;
-use anchor_lang::solana_program::sysvar::rent;
 use anchor_lang::{AccountDeserialize, InstructionData, ToAccountMetas};
 use regex::Regex;
 use solana_client::client_error::ClientError as SolanaClientError;
@@ -428,7 +427,6 @@ impl<'a> RequestBuilder<'a> {
                         ),
                         AccountMeta::new_readonly(system_program::ID, false),
                         AccountMeta::new_readonly(self.program_id, false),
-                        AccountMeta::new_readonly(rent::ID, false),
                     ],
                 };
                 accounts.extend_from_slice(&self.accounts);

+ 3 - 5
docs/src/tutorials/tutorial-6.md

@@ -70,16 +70,14 @@ This can be used, for example, to create multiple different associated accounts,
 which is associated *with* a new piece of metadata. In the token program, these pieces
 of metadata are mints, i.e., different token types.
 
-Lastly, notice the two accounts at the bottom of account context.
+Lastly, notice the `system_program` account at the bottom of account context.
 
 ```rust
-    rent: Sysvar<'info, Rent>,
     system_program: AccountInfo<'info>,
 ```
 
-In the same way that `rent` is required when using `init` in the previous tutorials,
-`rent` and additionally the `system-program` must be provided when creating an associated
-account. By convention, the names must be as given here.
+The `system-program` must be provided when creating an associated
+account. By convention, the name must be as given here.
 
 For more details on how to use `#[account(associated)]`, see [docs.rs](https://docs.rs/anchor-lang/latest/anchor_lang/derive.Accounts.html).
 

+ 0 - 1
examples/cashiers-check/programs/cashiers-check/src/lib.rs

@@ -99,7 +99,6 @@ pub struct CreateCheck<'info> {
     // Owner of the `from` token account.
     owner: AccountInfo<'info>,
     token_program: AccountInfo<'info>,
-    rent: Sysvar<'info, Rent>,
 }
 
 impl<'info> CreateCheck<'info> {

+ 0 - 2
examples/chat/programs/chat/src/lib.rs

@@ -40,7 +40,6 @@ pub struct CreateUser<'info> {
     user: ProgramAccount<'info, User>,
     #[account(signer)]
     authority: AccountInfo<'info>,
-    rent: Sysvar<'info, Rent>,
     system_program: AccountInfo<'info>,
 }
 
@@ -48,7 +47,6 @@ pub struct CreateUser<'info> {
 pub struct CreateChatRoom<'info> {
     #[account(init)]
     chat_room: Loader<'info, ChatRoom>,
-    rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 0 - 1
examples/composite/programs/composite/src/lib.rs

@@ -31,7 +31,6 @@ pub struct Initialize<'info> {
     pub dummy_a: ProgramAccount<'info, DummyA>,
     #[account(init)]
     pub dummy_b: ProgramAccount<'info, DummyB>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 0 - 1
examples/errors/programs/errors/src/lib.rs

@@ -46,7 +46,6 @@ pub struct HasOneError<'info> {
     #[account(init, has_one = owner)]
     my_account: ProgramAccount<'info, HasOneAccount>,
     owner: AccountInfo<'info>,
-    rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 0 - 1
examples/escrow/programs/escrow/src/lib.rs

@@ -109,7 +109,6 @@ pub struct InitializeEscrow<'info> {
     #[account(init)]
     pub escrow_account: ProgramAccount<'info, EscrowAccount>,
     pub token_program: AccountInfo<'info>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 0 - 1
examples/ido-pool/programs/ido-pool/src/lib.rs

@@ -211,7 +211,6 @@ pub struct InitializePool<'info> {
     pub creator_watermelon: CpiAccount<'info, TokenAccount>,
     #[account(constraint = token_program.key == &token::ID)]
     pub token_program: AccountInfo<'info>,
-    pub rent: Sysvar<'info, Rent>,
     pub clock: Sysvar<'info, Clock>,
 }
 

+ 0 - 1
examples/lockup/programs/lockup/src/lib.rs

@@ -219,7 +219,6 @@ pub struct CreateVesting<'info> {
     // Misc.
     #[account("token_program.key == &token::ID")]
     token_program: AccountInfo<'info>,
-    rent: Sysvar<'info, Rent>,
     clock: Sysvar<'info, Clock>,
 }
 

+ 0 - 4
examples/lockup/programs/registry/src/lib.rs

@@ -562,7 +562,6 @@ pub struct Initialize<'info> {
     reward_event_q: ProgramAccount<'info, RewardQueue>,
     #[account("pool_mint.decimals == 0")]
     pool_mint: CpiAccount<'info, Mint>,
-    rent: Sysvar<'info, Rent>,
 }
 
 impl<'info> Initialize<'info> {
@@ -616,7 +615,6 @@ pub struct CreateMember<'info> {
     // Misc.
     #[account("token_program.key == &token::ID")]
     token_program: AccountInfo<'info>,
-    rent: Sysvar<'info, Rent>,
 }
 
 impl<'info> CreateMember<'info> {
@@ -817,7 +815,6 @@ pub struct StartUnstake<'info> {
     #[account("token_program.key == &token::ID")]
     token_program: AccountInfo<'info>,
     clock: Sysvar<'info, Clock>,
-    rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]
@@ -940,7 +937,6 @@ pub struct DropReward<'info> {
     #[account("token_program.key == &token::ID")]
     token_program: AccountInfo<'info>,
     clock: Sysvar<'info, Clock>,
-    rent: Sysvar<'info, Rent>,
 }
 
 impl<'info> DropReward<'info> {

+ 2 - 11
examples/misc/programs/misc/src/context.rs

@@ -42,7 +42,6 @@ pub struct TestPdaInit<'info> {
     pub my_pda: ProgramAccount<'info, DataU16>,
     pub my_payer: AccountInfo<'info>,
     pub foo: AccountInfo<'info>,
-    pub rent: Sysvar<'info, Rent>,
     pub system_program: AccountInfo<'info>,
 }
 
@@ -52,7 +51,6 @@ pub struct TestPdaInitZeroCopy<'info> {
     #[account(init, seeds = [b"my-seed".as_ref(), &[bump]], payer = my_payer)]
     pub my_pda: Loader<'info, DataZeroCopy>,
     pub my_payer: AccountInfo<'info>,
-    pub rent: Sysvar<'info, Rent>,
     pub system_program: AccountInfo<'info>,
 }
 
@@ -73,7 +71,6 @@ pub struct RemainingAccounts {}
 pub struct Initialize<'info> {
     #[account(init)]
     pub data: ProgramAccount<'info, Data>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]
@@ -112,9 +109,8 @@ pub struct TestClose<'info> {
 // can *optionally* identify targets to be used as seeds for the program
 // derived address by using `with` (and it doesn't have to be a state account).
 // For example, the SPL token program uses a `Mint` account. Lastly,
-// `rent` and `system_program` are *required* by convention, since the
-// accounts are needed when creating the associated program address within
-// the program.
+// `system_program` are *required* by convention, since the account is needed
+// when creating the associated program address within the program.
 #[derive(Accounts)]
 pub struct TestInitAssociatedAccount<'info> {
     #[account(init, associated = authority, with = state, with = data, with = b"my-seed")]
@@ -123,7 +119,6 @@ pub struct TestInitAssociatedAccount<'info> {
     pub authority: AccountInfo<'info>,
     pub state: ProgramState<'info, MyState>,
     pub data: ProgramAccount<'info, Data>,
-    pub rent: Sysvar<'info, Rent>,
     pub system_program: AccountInfo<'info>,
 }
 
@@ -141,14 +136,12 @@ pub struct TestAssociatedAccount<'info> {
 pub struct TestU16<'info> {
     #[account(init)]
     pub my_account: ProgramAccount<'info, DataU16>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]
 pub struct TestI16<'info> {
     #[account(init)]
     pub data: ProgramAccount<'info, DataI16>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]
@@ -160,7 +153,6 @@ pub struct TestSimulateAssociatedAccount<'info> {
     pub my_account: ProgramAccount<'info, TestData>,
     #[account(mut, signer)]
     pub authority: AccountInfo<'info>,
-    pub rent: Sysvar<'info, Rent>,
     pub system_program: AccountInfo<'info>,
 }
 
@@ -168,5 +160,4 @@ pub struct TestSimulateAssociatedAccount<'info> {
 pub struct TestI8<'info> {
     #[account(init)]
     pub data: ProgramAccount<'info, DataI8>,
-    pub rent: Sysvar<'info, Rent>,
 }

+ 0 - 2
examples/multisig/programs/multisig/src/lib.rs

@@ -166,7 +166,6 @@ pub mod multisig {
 pub struct CreateMultisig<'info> {
     #[account(init)]
     multisig: ProgramAccount<'info, Multisig>,
-    rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]
@@ -177,7 +176,6 @@ pub struct CreateTransaction<'info> {
     // One of the owners. Checked in the handler.
     #[account(signer)]
     proposer: AccountInfo<'info>,
-    rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 0 - 1
examples/tutorial/basic-1/programs/basic-1/src/lib.rs

@@ -21,7 +21,6 @@ mod basic_1 {
 pub struct Initialize<'info> {
     #[account(init)]
     pub my_account: ProgramAccount<'info, MyAccount>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 0 - 1
examples/tutorial/basic-2/programs/basic-2/src/lib.rs

@@ -26,7 +26,6 @@ mod basic_2 {
 pub struct Create<'info> {
     #[account(init)]
     pub counter: ProgramAccount<'info, Counter>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 0 - 1
examples/tutorial/basic-3/programs/puppet/src/lib.rs

@@ -18,7 +18,6 @@ pub mod puppet {
 pub struct Initialize<'info> {
     #[account(init)]
     pub puppet: ProgramAccount<'info, Puppet>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 0 - 2
examples/tutorial/basic-5/programs/basic-5/src/lib.rs

@@ -29,7 +29,6 @@ pub mod basic_5 {
 pub struct CreateMint<'info> {
     #[account(init)]
     mint: ProgramAccount<'info, Mint>,
-    rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]
@@ -39,7 +38,6 @@ pub struct CreateToken<'info> {
     #[account(mut, signer)]
     authority: AccountInfo<'info>,
     mint: ProgramAccount<'info, Mint>,
-    rent: Sysvar<'info, Rent>,
     system_program: AccountInfo<'info>,
 }
 

+ 0 - 3
examples/zero-copy/programs/zero-copy/src/lib.rs

@@ -113,7 +113,6 @@ pub struct CreateFoo<'info> {
     foo: Loader<'info, Foo>,
     #[account(signer)]
     authority: AccountInfo<'info>,
-    rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]
@@ -139,7 +138,6 @@ pub struct CreateBar<'info> {
     #[account(signer)]
     authority: AccountInfo<'info>,
     foo: Loader<'info, Foo>,
-    rent: Sysvar<'info, Rent>,
     system_program: AccountInfo<'info>,
 }
 
@@ -156,7 +154,6 @@ pub struct UpdateBar<'info> {
 pub struct CreateLargeAccount<'info> {
     #[account(init)]
     event_q: Loader<'info, EventQ>,
-    rent: Sysvar<'info, Rent>,
 }
 
 #[derive(Accounts)]

+ 1 - 1
lang/derive/accounts/src/lib.rs

@@ -39,7 +39,7 @@ use syn::parse_macro_input;
 /// |:--|:--|:--|
 /// | `#[account(signer)]` | On raw `AccountInfo` structs. | Checks the given account signed the transaction. |
 /// | `#[account(mut)]` | On `AccountInfo`, `ProgramAccount` or `CpiAccount` structs. | Marks the account as mutable and persists the state transition. |
-/// | `#[account(init)]` | On `ProgramAccount` structs. | Marks the account as being initialized, skipping the account discriminator check. When using `init`, a `rent` `Sysvar` must be present in the `Accounts` struct. |
+/// | `#[account(init)]` | On `ProgramAccount` structs. | Marks the account as being initialized, skipping the account discriminator check. |
 /// | `#[account(close = <target>)]` | On `ProgramAccount` and `Loader` structs. | Marks the account as being closed at the end of the instruction's execution, sending the rent exemption lamports to the specified <target>. |
 /// | `#[account(has_one = <target>)]` | On `ProgramAccount` or `CpiAccount` structs | Checks the `target` field on the account matches the `target` field in the struct deriving `Accounts`. |
 /// | `#[account(seeds = [<seeds>], bump? = <target>, payer? = <target>, space? = <target>, owner? = <target>)]` | On `AccountInfo` structs | Seeds for the program derived address an `AccountInfo` struct represents. If bump is provided, then appends it to the seeds. On initialization, validates the given bump is the bump provided by `Pubkey::find_program_address`.|

+ 1 - 4
lang/src/ctor.rs

@@ -1,6 +1,5 @@
-use crate::{Accounts, Sysvar, ToAccountInfo};
+use crate::{Accounts, ToAccountInfo};
 use solana_program::account_info::AccountInfo;
-use solana_program::sysvar::rent::Rent;
 
 /// The Ctor accounts that can be used to create any account within the program
 /// itself (instead of creating the account on the client).
@@ -25,6 +24,4 @@ pub struct Ctor<'info> {
     pub system_program: AccountInfo<'info>,
     // The program whose state is being constructed.
     pub program: AccountInfo<'info>,
-    // Rent sysvar.
-    pub rent: Sysvar<'info, Rent>,
 }

+ 0 - 1
lang/src/idl.rs

@@ -60,7 +60,6 @@ pub struct IdlCreateBuffer<'info> {
     pub buffer: ProgramAccount<'info, IdlAccount>,
     #[account(signer, constraint = authority.key != &Pubkey::new_from_array([0u8; 32]))]
     pub authority: AccountInfo<'info>,
-    pub rent: Sysvar<'info, Rent>,
 }
 
 // Accounts for upgrading the canonical IdlAccount with the buffer.

+ 14 - 4
lang/syn/src/codegen/accounts/constraints.rs

@@ -9,11 +9,21 @@ use quote::quote;
 use syn::Expr;
 
 pub fn generate(f: &Field) -> proc_macro2::TokenStream {
-    let checks: Vec<proc_macro2::TokenStream> = linearize(&f.constraints)
+    let constraints = linearize(&f.constraints);
+
+    let rent = constraints
+        .iter()
+        .any(|c| matches!(c, Constraint::RentExempt(ConstraintRentExempt::Enforce)))
+        .then(|| quote! { let __anchor_rent = Rent::get()?; })
+        .unwrap_or_else(|| quote! {});
+
+    let checks: Vec<proc_macro2::TokenStream> = constraints
         .iter()
         .map(|c| generate_constraint(f, c))
         .collect();
+
     quote! {
+        #rent
         #(#checks)*
     }
 }
@@ -240,7 +250,7 @@ pub fn generate_constraint_rent_exempt(
     match c {
         ConstraintRentExempt::Skip => quote! {},
         ConstraintRentExempt::Enforce => quote! {
-            if !rent.is_exempt(#info.lamports(), #info.try_data_len()?) {
+            if !__anchor_rent.is_exempt(#info.lamports(), #info.try_data_len()?) {
                 return Err(anchor_lang::__private::ErrorCode::ConstraintRentExempt.into());
             }
         },
@@ -520,7 +530,7 @@ pub fn generate_pda(
                 #seeds_constraint
 
                 // Fund the account for rent exemption.
-                let required_lamports = rent
+                let required_lamports = __anchor_rent
                     .minimum_balance(anchor_spl::token::TokenAccount::LEN)
                     .max(1)
                     .saturating_sub(#field.to_account_info().lamports());
@@ -598,7 +608,7 @@ pub fn generate_pda(
                     #payer
                     #seeds_constraint
 
-                    let lamports = rent.minimum_balance(space);
+                    let lamports = __anchor_rent.minimum_balance(space);
                     let ix = anchor_lang::solana_program::system_instruction::create_account(
                         payer.to_account_info().key,
                         #field.to_account_info().key,

+ 6 - 3
lang/syn/src/codegen/program/handlers.rs

@@ -83,7 +83,8 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream {
                 let to = Pubkey::create_with_seed(&base, seed, owner).unwrap();
                 // Space: account discriminator || authority pubkey || vec len || vec data
                 let space = 8 + 32 + 4 + data_len as usize;
-                let lamports = accounts.rent.minimum_balance(space);
+                let rent = Rent::get()?;
+                let lamports = rent.minimum_balance(space);
                 let seeds = &[&[nonce][..]];
                 let ix = anchor_lang::solana_program::system_instruction::create_account_with_seed(
                     from,
@@ -202,7 +203,8 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream {
                             let owner = ctor_accounts.program.key;
                             let to = Pubkey::create_with_seed(&base, seed, owner).unwrap();
                             let space = 8 + std::mem::size_of::<#name>();
-                            let lamports = ctor_accounts.rent.minimum_balance(std::convert::TryInto::try_into(space).unwrap());
+                            let rent = Rent::get()?;
+                            let lamports = rent.minimum_balance(std::convert::TryInto::try_into(space).unwrap());
                             let seeds = &[&[nonce][..]];
                             let ix = anchor_lang::solana_program::system_instruction::create_account_with_seed(
                                 from,
@@ -282,7 +284,8 @@ pub fn generate(program: &Program) -> proc_macro2::TokenStream {
                             let owner = ctor_accounts.program.key;
                             let to = Pubkey::create_with_seed(&base, seed, owner).unwrap();
                             let space = anchor_lang::__private::AccountSize::size(&instance)?;
-                            let lamports = ctor_accounts.rent.minimum_balance(std::convert::TryInto::try_into(space).unwrap());
+                            let rent = Rent::get()?;
+                            let lamports = rent.minimum_balance(std::convert::TryInto::try_into(space).unwrap());
                             let seeds = &[&[nonce][..]];
                             let ix = anchor_lang::solana_program::system_instruction::create_account_with_seed(
                                 from,

+ 1 - 11
ts/src/program/namespace/state.ts

@@ -1,11 +1,6 @@
 import EventEmitter from "eventemitter3";
 import camelCase from "camelcase";
-import {
-  PublicKey,
-  SystemProgram,
-  SYSVAR_RENT_PUBKEY,
-  Commitment,
-} from "@solana/web3.js";
+import { PublicKey, SystemProgram, Commitment } from "@solana/web3.js";
 import Provider from "../../provider";
 import { Idl, IdlStateMethod } from "../../idl";
 import Coder, { stateDiscriminator } from "../../coder";
@@ -246,11 +241,6 @@ function stateInstructionKeys(
       },
 
       { pubkey: programId, isWritable: false, isSigner: false },
-      {
-        pubkey: SYSVAR_RENT_PUBKEY,
-        isWritable: false,
-        isSigner: false,
-      },
     ];
   } else {
     validateAccounts(m.accounts, accounts);