-
Notifications
You must be signed in to change notification settings - Fork 113
fix:support-classic-accounts-trustlines #1746
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
base: main
Are you sure you want to change the base?
fix:support-classic-accounts-trustlines #1746
Conversation
|
@Dhanraj30 Could you fix the coding formatting please |
| LedgerKey::Trustline(k) => current.account_ids.contains(&k.account_id), | ||
| LedgerKey::Trustline(k) => { | ||
| current.account_ids.contains(&k.account_id) || | ||
| current.account_ids.iter().any(|id| match &k.asset { | ||
| TrustLineAsset::CreditAlphanum4(a4) => a4.issuer == *id, | ||
| TrustLineAsset::CreditAlphanum12(a12) => a12.issuer == *id, |
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.
Pulling in every trustline for an asset unfortunately doesn't scale well with the current implementation of snapshots, which was why I left it out. If you pass in the address for a very popular asset, the file becomes huge and unusable.
For assets with much less trust lines though I can see this being very useful so maybe we should add it.
I think this use case will be better served by the following issue that hopefully we can implement in the near future:
Thoguhts @fnando ?
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.
Pull Request Overview
This PR adds support for classic accounts and trustlines in snapshots by updating the filtering logic for trustline and contract data entries.
- Updates trustline filtering to also consider asset issuers from legacy accounts.
- Adjusts the ledger entry saving logic for contract data to bypass the original condition.
Comments suppressed due to low confidence (1)
cmd/soroban-cli/src/commands/snapshot/create.rs:351
- The change to always save entries for ContractData (line 351) bypasses the original 'keep' condition. Please verify that this behavior aligns with the intended snapshot inclusion requirements for legacy accounts.
true
| let keep = match &key { | ||
| LedgerKey::Account(k) => current.account_ids.contains(&k.account_id), | ||
| LedgerKey::Trustline(k) => current.account_ids.contains(&k.account_id), | ||
| LedgerKey::Trustline(k) => { |
Copilot
AI
Jun 24, 2025
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.
[nitpick] Consider extracting the complex trustline filtering logic (lines 292-298) into a helper function to improve readability and maintainability.
#1739
What
support for classic accounts and trustlines in snapshots.
Why
Support classic accounts and trustlines in snapshots. This change is being made to ensure that legacy account and trustline information is correctly included in the ledger snapshots. Classic accounts and trustlines were previously overlooked, which caused issues
Known limitations
N/A