Skip to content
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: 1 addition & 1 deletion .github/packages/npm-package/package.json.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@magicblock-labs/${node_pkg}",
"description": "MagicBlock Ephemeral VRF Oracle (${node_pkg})",
"version": "0.2.1",
"version": "0.2.2",
"repository": {
"type": "git",
"url": "git+https://github.com/magicblock-labs/ephemeral-vrf.git"
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = ["api", "program", "sdk", "src", "vrf", "vrf-cli", "vrf-oracle"]

[workspace.package]
version = "0.2.1"
version = "0.2.2"
edition = "2021"
license = "Business Source License 1.1"
authors = ["MagicBlock Labs <dev@magicblock.xyz>"]
Expand All @@ -26,9 +26,9 @@ crossbeam-channel = "0.5.15"
curve25519-dalek = { version = "4.1.3", default-features = false }
env_logger = "0.11.7"
ephemeral-rollups-sdk = "0.2.4"
ephemeral-vrf = { path = "./vrf", version = "0.2.1" }
ephemeral-vrf-api = { path = "./api", version = "0.2.1" }
ephemeral-vrf-sdk-vrf-macro = { path = "sdk/vrf-macro", version = "0.2.1" }
ephemeral-vrf = { path = "./vrf", version = "0.2.2" }
ephemeral-vrf-api = { path = "./api", version = "0.2.2" }
ephemeral-vrf-sdk-vrf-macro = { path = "sdk/vrf-macro", version = "0.2.2" }
futures = "0.3.31"
futures-core = "0.3.31"
futures-util = "0.3.31"
Expand Down
5 changes: 4 additions & 1 deletion api/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ pub fn initialize_oracle_queue(
index: u8,
bytes_to_allocate: Option<u32>,
) -> Vec<Instruction> {
println!("Queue: {:?}", oracle_queue_pda(&identity, index).0.to_string());
println!(
"Queue: {:?}",
oracle_queue_pda(&identity, index).0.to_string()
);
Comment on lines +77 to +80
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider removing or converting this debug println! to proper logging.

This unconditional println! will output to stdout every time initialize_oracle_queue is called, which may pollute output in production SDK usage or CLI tools. Consider either:

  1. Removing it entirely if it was for debugging purposes
  2. Using a proper logging framework (e.g., log::debug!) so users can control verbosity
♻️ Suggested fix using log crate
-    println!(
-        "Queue: {:?}",
-        oracle_queue_pda(&identity, index).0.to_string()
-    );
+    log::debug!(
+        "Queue: {:?}",
+        oracle_queue_pda(&identity, index).0.to_string()
+    );

Or remove entirely if not needed:

-    println!(
-        "Queue: {:?}",
-        oracle_queue_pda(&identity, index).0.to_string()
-    );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
println!(
"Queue: {:?}",
oracle_queue_pda(&identity, index).0.to_string()
);
🤖 Prompt for AI Agents
In `@api/src/sdk.rs` around lines 77 - 80, The unconditional println! in
initialize_oracle_queue that prints oracle_queue_pda(&identity,
index).0.to_string() should be removed or converted to a proper log call; locate
the println! in function initialize_oracle_queue (and any direct use of
oracle_queue_pda(&identity, index) there) and either delete the println! or
replace it with a log::debug! (or similar) call so output is controllable by the
logging framework rather than always writing to stdout.

let target_size = bytes_to_allocate.unwrap_or(9500);
let inits = target_size.div_ceil(10240);
let mut ixs = Vec::with_capacity(inits as usize);
Expand Down
40 changes: 21 additions & 19 deletions sdk/src/pda.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use solana_program::pubkey::Pubkey;
use solana_program::pubkey::Pubkey as SolanaPubkey;

use crate::{consts, Pubkey};

/// NOTE: Copy/Pasted from delegation-program/src/pda.rs (modify there if needed)
#[macro_export]
Expand Down Expand Up @@ -72,33 +74,33 @@ macro_rules! ephemeral_balance_seeds_from_payer {
}

pub fn delegation_record_pda_from_delegated_account(delegated_account: &Pubkey) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
delegation_record_seeds_from_delegated_account!(delegated_account),
&crate::id(),
&consts::VRF_PROGRAM_ID,
)
.0
}

pub fn delegation_metadata_pda_from_delegated_account(delegated_account: &Pubkey) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
delegation_metadata_seeds_from_delegated_account!(delegated_account),
&crate::id(),
&consts::VRF_PROGRAM_ID,
)
.0
}

pub fn commit_state_pda_from_delegated_account(delegated_account: &Pubkey) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
commit_state_seeds_from_delegated_account!(delegated_account),
&crate::id(),
&consts::VRF_PROGRAM_ID,
)
.0
}

pub fn commit_record_pda_from_delegated_account(delegated_account: &Pubkey) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
commit_record_seeds_from_delegated_account!(delegated_account),
&crate::id(),
&consts::VRF_PROGRAM_ID,
)
.0
}
Expand All @@ -107,45 +109,45 @@ pub fn delegate_buffer_pda_from_delegated_account_and_owner_program(
delegated_account: &Pubkey,
owner_program: &Pubkey,
) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
delegate_buffer_seeds_from_delegated_account!(delegated_account),
owner_program,
)
.0
}

pub fn undelegate_buffer_pda_from_delegated_account(delegated_account: &Pubkey) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
undelegate_buffer_seeds_from_delegated_account!(delegated_account),
&crate::id(),
&consts::VRF_PROGRAM_ID,
)
.0
}

pub fn fees_vault_pda() -> Pubkey {
Pubkey::find_program_address(fees_vault_seeds!(), &crate::id()).0
SolanaPubkey::find_program_address(fees_vault_seeds!(), &consts::VRF_PROGRAM_ID).0
}

pub fn validator_fees_vault_pda_from_validator(validator: &Pubkey) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
validator_fees_vault_seeds_from_validator!(validator),
&crate::id(),
&consts::VRF_PROGRAM_ID,
)
.0
}

pub fn program_config_from_program_id(program_id: &Pubkey) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
program_config_seeds_from_program_id!(program_id),
&crate::id(),
&consts::VRF_PROGRAM_ID,
)
.0
}

pub fn ephemeral_balance_pda_from_payer(payer: &Pubkey, index: u8) -> Pubkey {
Pubkey::find_program_address(
SolanaPubkey::find_program_address(
ephemeral_balance_seeds_from_payer!(payer, index),
&crate::id(),
&consts::VRF_PROGRAM_ID,
)
.0
}
Loading