-
Notifications
You must be signed in to change notification settings - Fork 48
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
chore: review-cleanup #929
Conversation
984de4b
to
ee6f87a
Compare
6c14282
to
a28e3fe
Compare
a28e3fe
to
c2fa8f9
Compare
}, | ||
{ | ||
name: 'solPoolPda'; | ||
isMut: true; | ||
isSigner: false; | ||
isOptional: true; | ||
docs: [ | ||
'Sol pool pda is used to store compressed sol.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't actually store compressed sol but native sol, so may be confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joa both not wrong, the native sol that has been compressed.
Makes sense to be explicit let me fix it in https://github.com/Lightprotocol/light-protocol/actions/runs/9754900751/job/26922536668?pr=931 since the tests are already green here.
}, | ||
{ | ||
name: 'accountCompressionProgram', | ||
isMut: false, | ||
isSigner: false, | ||
docs: ['Merkle trees.'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unclear docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an error in the idl the full comment reads:
/// CHECK: Account compression program is used to update state and address
/// Merkle trees.
```
if inputs.is_compress { | ||
compress_lamports(inputs, ctx) | ||
} else if inputs.compress_or_decompress_lamports.is_some() { | ||
decompress_lamports(inputs, ctx) | ||
} else { | ||
Ok(()) | ||
decompress_lamports(inputs, ctx) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is now by default always going to execute decompress_lamports()
,no?
is_compress
is not optional, so the default usage is is_compress = false, compress_or_decompress_lamports = None.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function yes but we only execute the function when compress_or_decompress_lamports
is some.
Hence, this function will never be executed if we don't want to compress or decompress.
@@ -61,9 +59,7 @@ pub fn decompress_lamports< | |||
None => return err!(SystemProgramError::DeCompressLamportsUndefinedForDecompressSol), | |||
}; | |||
|
|||
transfer_lamports(&sol_pool_pda, &recipient, lamports)?; | |||
|
|||
Ok(()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it make any difference to not emit Ok(()) here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's cleaner not to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving, required changes will be addressed in #931
Changes:
indices
->leaf_indices
merkle_tree.sequence_number
after it has been incrementedroots
toinput_compressed_account_roots
fetch_roots
->fetch_input_compressed_account_roots
hash_input_compressed_accounts
-> enforce input ordering because we allow Merkle trees to be inserted into hashed_pubkeys without checking whether these exist already