feat: check risk strategies - #1429
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds configurable AML risk checking with Assessment against linked issues:
Assessment against linked issues: Out-of-scope changes:
Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
65d1e07 to
5104c59
Compare
7f9ba49 to
8a4f601
Compare
5104c59 to
b7addc0
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@magicblock-chainlink/src/chainlink/fetch_cloner/mod.rs`:
- Around line 1577-1582: The signer collection in lines 1584-1602 currently
includes signers from all delegation_actions regardless of the check_strategy
result, which defeats the risk-check optimization. After the
delegation_actions_require_risk_check guard, add conditional logic based on
risk_service.check_strategy(): when the strategy indicates RelevantPrograms,
filter the actions with instruction_involves_risk_relevant_program before
collecting signers; when the strategy indicates AllSigners, preserve the current
behavior of collecting from all actions. Also add a test case that validates the
filtering behavior by including a mixed batch with both relevant and unrelated
actions to ensure only relevant signers are sent to check_addresses.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 37aea70b-9b7d-4458-a5a8-acf7df61fc2d
📒 Files selected for processing (7)
config.example.tomlmagicblock-aml/src/lib.rsmagicblock-chainlink/src/chainlink/fetch_cloner/mod.rsmagicblock-chainlink/src/chainlink/fetch_cloner/tests.rsmagicblock-chainlink/tests/10_aml_undelegation.rsmagicblock-config/src/config/chain.rsmagicblock-config/src/config/mod.rs
39529ab to
fc4f0d6
Compare
b7addc0 to
4de6e54
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
87d5e7c to
1e477a3
Compare
6863017 to
ea76e6a
Compare
405bd42 to
c4a54d5
Compare
c4a54d5 to
b40b2b1
Compare
ea76e6a to
dee4d61
Compare
c40cc22 to
dd316c3
Compare
dee4d61 to
9ae900f
Compare
c40cc22 to
836e5f9
Compare
836e5f9 to
2e64b83
Compare
9ae900f to
27e8c37
Compare
4761dba to
dcebe2c
Compare
27e8c37 to
f23a497
Compare
dcebe2c to
7368b12
Compare
f23a497 to
845638d
Compare
7368b12 to
c0554ec
Compare
845638d to
3288f82
Compare
c0554ec to
0b69900
Compare
3288f82 to
25ec8f8
Compare
25ec8f8 to
06a7780
Compare
f324175 to
f16f079
Compare
06a7780 to
7177f6c
Compare

Summary
Introduce a configurable risk checking strategy: aggressively check all delegation actions, or only those involving programs relevant to money laundering: token programs and the magic program. Closes #1435
Breaking Changes
Summary by CodeRabbit
New Features
Documentation