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

solana localnet #62

Draft
wants to merge 16 commits into
base: localnet-authenticated-call
Choose a base branch
from
Draft

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Nov 13, 2024

No description provided.

@fadeev
Copy link
Member Author

fadeev commented Nov 18, 2024

npx hardhat localnet
Deploying Solana program: ./packages/localnet/src/solana/deploy/protocol_contracts_solana.so
Running command: solana program deploy --program-id ./packages/localnet/src/solana/deploy/protocol_contracts_solana-keypair.json --keypair ./packages/localnet/src/solana/deploy/protocol_contracts_solana-keypair.json ./packages/localnet/src/solana/deploy/protocol_contracts_solana.so --url localhost
Deployment error: Command failed: solana program deploy --program-id ./packages/localnet/src/solana/deploy/protocol_contracts_solana-keypair.json --keypair ./packages/localnet/src/solana/deploy/protocol_contracts_solana-keypair.json ./packages/localnet/src/solana/deploy/protocol_contracts_solana.so --url localhost
Error: Account CgkjyKhvqDSSptxXyRLp4QD8vEyEwCBPmysDRwvFsWsw is not an upgradeable program or already in use

Error initializing localnet: Error: Command failed: solana program deploy --program-id ./packages/localnet/src/solana/deploy/protocol_contracts_solana-keypair.json --keypair ./packages/localnet/src/solana/deploy/protocol_contracts_solana-keypair.json ./packages/localnet/src/solana/deploy/protocol_contracts_solana.so --url localhost
Error: Account CgkjyKhvqDSSptxXyRLp4QD8vEyEwCBPmysDRwvFsWsw is not an upgradeable program or already in use

@fadeev
Copy link
Member Author

fadeev commented Nov 18, 2024

I've copied the source for the Solana program and changed the program ID.

@fadeev fadeev changed the base branch from main to localnet-authenticated-call November 18, 2024 13:56
@fadeev
Copy link
Member Author

fadeev commented Nov 28, 2024

@skosito trying to make a deposit to the gateway and getting an error.

npx hardhat localnet
Initialized gateway program
Deployment error: Simulation failed. 
Message: Transaction simulation failed: Error processing Instruction 0: Program failed to complete. 
Logs: 
[
  "Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d invoke [1]",
  "Program log: Instruction: Deposit",
  "Program log: Error: memory allocation failed, out of memory",
  "Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d consumed 1148 of 200000 compute units",
  "Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d failed: SBF program panicked"
]. 
Catch the `SendTransactionError` and call `getLogs()` on it for full details.
Logs: [
  'Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d invoke [1]',
  'Program log: Instruction: Deposit',
  'Program log: Error: memory allocation failed, out of memory',
  'Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d consumed 1148 of 200000 compute units',
  'Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d failed: SBF program panicked'
]
Error initializing localnet: Error: Simulation failed. 
Message: Transaction simulation failed: Error processing Instruction 0: Program failed to complete. 
Logs: 
[
  "Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d invoke [1]",
  "Program log: Instruction: Deposit",
  "Program log: Error: memory allocation failed, out of memory",
  "Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d consumed 1148 of 200000 compute units",
  "Program 94U5AHQMKkV5txNJ17QPXWoh474PheGou6cNP2FEuL1d failed: SBF program panicked"
]. 
Catch the `SendTransactionError` and call `getLogs()` on it for full details.

@fadeev
Copy link
Member Author

fadeev commented Nov 29, 2024

Using the following schema to decode:

const DepositInstructionSchema = {
  struct: {
    discriminator: { array: { type: "u8", length: 8 } }, // 8-byte discriminator
    amount: "u64", // Amount as uint64
    receiver: { array: { type: "u8", length: 20 } }, // Receiver as 20-byte array
  },
};

Getting error:

Instruction for program detected: {
  accounts: [ 0, 1, 2 ],
  data: '2qe8pjwrUAq1ZzgM8Ko9Ayb7bsxQHaEzni4eem9WbycarsM4Ns',
  programIdIndex: 3,
  stackHeight: null
}
Error processing transaction 5zZtiU4oPmQGd1EnVU1ZXszn2UxgQVS9z3mEo9XUJMvpZqJ3AvtyfpzS43AYfn4JoJabShhaw7WTwbt4i3ggbcgm: Error: Error in schema, the buffer is smaller than expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants