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

[DRAFT] Solana ChainWriter #935

Draft
wants to merge 22 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e67d492
Starting mapping out Solana ChainWriter
silaslenihan Oct 11, 2024
3802482
Added Address searcher for decoded data
silaslenihan Oct 25, 2024
aa5733c
Introduced new Solana config
silaslenihan Oct 28, 2024
71867ed
Completed iteration of ChainWriter config
silaslenihan Oct 29, 2024
fa85301
Refactored lookup tables
silaslenihan Oct 30, 2024
fa40469
Created sample configuration for execute method
silaslenihan Oct 30, 2024
786d9f8
Update chain_writer_test.go
pablolagreca Oct 30, 2024
7ba862d
Cleaned up exec config and added comments
silaslenihan Oct 30, 2024
e9fe535
Removed ValueSeeds and consolidated into a single Seeds array
silaslenihan Nov 4, 2024
ed8ca3b
Added decode location
silaslenihan Nov 4, 2024
9648729
Added commit report config example
silaslenihan Nov 4, 2024
e486594
Slight changes to IDL and codec
silaslenihan Nov 6, 2024
ecb1629
Updated ChainWriter implementation to reflect new design changes
silaslenihan Nov 15, 2024
87191d2
Added codec implementation
silaslenihan Nov 18, 2024
aeb45bd
updated CCIP example
silaslenihan Nov 19, 2024
4ab6a8c
Moved lookups logic to separate file
silaslenihan Nov 20, 2024
7baa501
unit tests for lookups
silaslenihan Nov 21, 2024
7012b9a
Added utils to their own package
silaslenihan Nov 21, 2024
e8fec1b
Updated lookup tests and helpers
silaslenihan Nov 25, 2024
183e7e2
Removed helpers_test
silaslenihan Nov 25, 2024
ed1270d
refactored ccip example
silaslenihan Nov 25, 2024
843eff7
Completed chained lookup integration test
silaslenihan Nov 26, 2024
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
5 changes: 3 additions & 2 deletions contracts/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ test = "pnpm run test"

[programs.localnet]
access_controller = "9xi644bRR8birboDGdTiwBq3C7VEeR7VuamRYYXCubUW"
log-read-test = "J1zQwrBNBngz26jRPNWsUSZMHJwBwpkoDitXRV95LdK4"
log_read_test = "J1zQwrBNBngz26jRPNWsUSZMHJwBwpkoDitXRV95LdK4"
ocr_2 = "cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ" # need to rename the idl to satisfy anchor.js...
store = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"
store = "HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny"
write_test = "39vbQVpEMtZtg3e6ZSE7nBSzmNZptmW45WnLkbqEe4TU"
7 changes: 7 additions & 0 deletions contracts/Cargo.lock

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

1 change: 1 addition & 0 deletions contracts/artifacts/localnet/write_test-keypair.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[26,39,164,161,246,97,149,0,58,187,146,162,53,35,107,2,117,242,83,171,48,7,63,240,69,221,239,45,97,55,112,106,192,228,214,205,123,71,58,23,62,229,166,213,149,122,96,145,35,150,16,156,247,199,242,108,173,80,62,231,39,196,27,192]
60 changes: 33 additions & 27 deletions contracts/pnpm-lock.yaml

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

19 changes: 19 additions & 0 deletions contracts/programs/write_test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "write-test"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "write_test"

[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []

[dependencies]
anchor-lang = "0.29.0"
2 changes: 2 additions & 0 deletions contracts/programs/write_test/Xargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []
52 changes: 52 additions & 0 deletions contracts/programs/write_test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
use anchor_lang::prelude::*;

declare_id!("39vbQVpEMtZtg3e6ZSE7nBSzmNZptmW45WnLkbqEe4TU");

#[program]
pub mod write_test {
use super::*;

pub fn initialize(ctx: Context<Initialize>, lookup_table: Pubkey) -> Result<()> {
let data = &mut ctx.accounts.data_account;
data.version = 1;
data.administrator = ctx.accounts.admin.key();
data.pending_administrator = Pubkey::default();
data.lookup_table = lookup_table;

Ok(())
}

}

#[derive(Accounts)]
pub struct Initialize<'info> {
/// PDA account, derived from seeds and created by the System Program in this instruction
#[account(
init, // Initialize the account
payer = admin, // Specify the payer
space = DataAccount::SIZE, // Specify the account size
seeds = [b"data"], // Define the PDA seeds
bump // Use the bump seed
)]
pub data_account: Account<'info, DataAccount>,

/// Admin account that pays for PDA creation and signs the transaction
#[account(mut)]
pub admin: Signer<'info>,

/// System Program is required for PDA creation
pub system_program: Program<'info, System>,
}

#[account]
pub struct DataAccount {
pub version: u8,
pub administrator: Pubkey,
pub pending_administrator: Pubkey,
pub lookup_table: Pubkey,
}

impl DataAccount {
/// The total size of the `DataAccount` struct, including the discriminator
pub const SIZE: usize = 8 + 1 + 32 * 3; // 8 bytes for discriminator + 1 byte for version + 32 bytes * 3 pubkeys
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ require (
github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12
github.com/stretchr/testify v1.9.0
github.com/test-go/testify v1.1.4
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
golang.org/x/sync v0.8.0
Expand Down
Loading
Loading