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

feat: forester service #774

Merged
merged 3 commits into from
Jun 4, 2024
Merged

feat: forester service #774

merged 3 commits into from
Jun 4, 2024

Conversation

sergeytimoshin
Copy link
Contributor

No description provided.

Copy link
Contributor

@ananas-block ananas-block left a comment

Choose a reason for hiding this comment

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

great that the forester works!
Couple comments here and there.

test-utils/src/e2e_test_env.rs Outdated Show resolved Hide resolved
test-utils/src/e2e_test_env.rs Show resolved Hide resolved
test-utils/src/system_program.rs Outdated Show resolved Hide resolved
programs/account-compression/src/state/nullify_event.rs Outdated Show resolved Hide resolved
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TokenData {
#[serde(rename = "amount")]
pub amount: i32,
Copy link
Contributor

Choose a reason for hiding this comment

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

amounts are ususally u64s, Nick told me they prefer i64s because those are natively supported in postgres, but i32 seems small and risky to me. Absolute amounts with many decimals can easily be in the billions.

Copy link
Contributor

Choose a reason for hiding this comment

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

same with delegate amount, and is native

Copy link
Contributor

Choose a reason for hiding this comment

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

ah this is just copied from photon right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's autogenerated, but it should still be u64, I'll have a look https://github.com/helius-labs/photon/blob/main/src/common/typedefs/unsigned_integer.rs#L10

#[serde(rename = "dataHash")]
pub data_hash: String,
#[serde(rename = "discriminator")]
pub discriminator: i32,
Copy link
Contributor

Choose a reason for hiding this comment

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

discriminator for us is u64

forester/src/indexer/photon_indexer.rs Outdated Show resolved Hide resolved
}
}

fn account_nullified(&mut self, _merkle_tree_pubkey: Pubkey, _account_hash: &str) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what would be the use case for this method?

forester/src/nullifier/nullify.rs Outdated Show resolved Hide resolved
forester/src/utils.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@SwenSchaeferjohann SwenSchaeferjohann left a comment

Choose a reason for hiding this comment

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

Can we add a readme.md file to the forester? A brief high-level summary of the key functions and how to run it should be fine.

@@ -37,3 +39,4 @@ solana-rpc-client = { git = "https://github.com/Lightprotocol/agave", branch = "
solana-rpc-client-api = { git = "https://github.com/Lightprotocol/agave", branch = "v1.18.11-enforce-cpi-tracking" }
solana-runtime = { git = "https://github.com/Lightprotocol/agave", branch = "v1.18.11-enforce-cpi-tracking" }
solana-sdk = { git = "https://github.com/Lightprotocol/agave", branch = "v1.18.11-enforce-cpi-tracking" }
solana-transaction-status = { git = "https://github.com/Lightprotocol/agave", branch = "v1.18.11-enforce-cpi-tracking" }
Copy link
Contributor

Choose a reason for hiding this comment

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

what is switching back to the main agave repo contingent on?

Copy link
Contributor

Choose a reason for hiding this comment

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

On this commit being released:

anza-xyz/agave#1504

Without it, our program tests can't track inner instructions, so we wouldn't be able to test the event emission.

Copy link
Contributor

@SwenSchaeferjohann SwenSchaeferjohann May 30, 2024

Choose a reason for hiding this comment

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

what do these signatures do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

merkle_tree: address of the state merkle tree
nullifier_queue: address of the nullifier queue
payer: payer's keypair

(I added this info to the README.md)

@sergeytimoshin sergeytimoshin force-pushed the sergey/forester branch 5 times, most recently from 54dd6bc to 984cf31 Compare May 31, 2024 17:03
Copy link
Contributor

@SwenSchaeferjohann SwenSchaeferjohann left a comment

Choose a reason for hiding this comment

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

lfg! looks good to me

@sergeytimoshin sergeytimoshin force-pushed the sergey/forester branch 3 times, most recently from 054e2f1 to 014fc98 Compare June 3, 2024 10:30
@sergeytimoshin sergeytimoshin marked this pull request as draft June 3, 2024 12:28
@sergeytimoshin sergeytimoshin marked this pull request as ready for review June 3, 2024 13:13
The timeout for the 'forester-tests' workflow in GitHub Actions has been extended from 30 minutes to 60 minutes, improving the chance of test completion for longer running tests.
@ananas-block ananas-block merged commit 0b914e5 into main Jun 4, 2024
14 checks passed
@ananas-block ananas-block deleted the sergey/forester branch June 4, 2024 11:44
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.

4 participants