Skip to content

feat: external risk service - #1407

Open
Dodecahedr0x wants to merge 5 commits into
engine-integrationfrom
dode/external-risk-server
Open

feat: external risk service#1407
Dodecahedr0x wants to merge 5 commits into
engine-integrationfrom
dode/external-risk-server

Conversation

@Dodecahedr0x

@Dodecahedr0x Dodecahedr0x commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Relies on the query filtering service to get risk results, sharing the same cache to reduce API calls. Closes #1433

Breaking Changes

  • Yes — The config changes to point to the service

Summary by CodeRabbit

  • New Features
    • Switched address risk checking to a dedicated risk server using pubkey-based queries.
    • Risk configuration now uses risk-server-url and request-timeout.
  • Bug Fixes
    • Updated validator/chainlink integration to match the server-based risk-check flow.
    • Improved and simplified risk-check error reporting.
  • Documentation
    • Refreshed the example config and risk-field descriptions for the new server settings (old Range settings removed).
  • Tests
    • Updated mock risk server endpoints and integration tests to use the new GET /risk?pubkey= response format.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Too many files!

This PR contains 395 files, which is 295 over the limit of 100.

To get a review, narrow the scope:
• coderabbit review --committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

Usage-priced reviews support at most 300 files.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d785191a-d11a-4c73-a0c1-010ec866dfc3

📥 Commits

Reviewing files that changed from the base of the PR and between 233217c and 9e0810e.

⛔ Files ignored due to path filters (6)
  • Cargo.lock is excluded by !**/*.lock
  • programs/elfs/guinea.so is excluded by !**/*.so
  • test-integration/Cargo.lock is excluded by !**/*.lock
  • test-integration/programs/memo/memo.so is excluded by !**/*.so
  • test-integration/programs/redline/redline.so is excluded by !**/*.so
  • test-integration/schedulecommit/elfs/mdp.so is excluded by !**/*.so
📒 Files selected for processing (643)
  • .agents/context/architecture.md
  • .agents/context/crate-map.md
  • .agents/context/crates/magicblock-account-cloner.md
  • .agents/context/crates/magicblock-accounts-db.md
  • .agents/context/crates/magicblock-aml.md
  • .agents/context/crates/magicblock-aperture.md
  • .agents/context/crates/magicblock-api.md
  • .agents/context/crates/magicblock-chainlink.md
  • .agents/context/crates/magicblock-committor-program.md
  • .agents/context/crates/magicblock-committor-service.md
  • .agents/context/crates/magicblock-config.md
  • .agents/context/crates/magicblock-core.md
  • .agents/context/crates/magicblock-ledger.md
  • .agents/context/crates/magicblock-magic-program-api.md
  • .agents/context/crates/magicblock-metrics.md
  • .agents/context/crates/magicblock-rpc-client.md
  • .agents/context/crates/magicblock-runtime.md
  • .agents/context/crates/magicblock-services.md
  • .agents/context/crates/magicblock-table-mania.md
  • .agents/context/crates/magicblock-task-scheduler.md
  • .agents/context/crates/magicblock-validator-admin.md
  • .agents/context/crates/magicblock-validator.md
  • .agents/context/crates/magicblock-version.md
  • .agents/context/crates/mbv-leader.md
  • .agents/context/crates/mbv-tui.md
  • .agents/context/crates/mbv-verifier.md
  • .agents/context/crates/mbv.md
  • .agents/context/crates/storage-proto.md
  • .agents/context/crates/test-kit.md
  • .agents/rules/invariants.md
  • .agents/rules/testing-and-validation.md
  • .agents/skills/mbv-check/SKILL.md
  • .agents/specs/validator-specification.md
  • .github/actions/setup-build-env/action.yml
  • .github/actions/setup-solana/action.yml
  • .github/workflows/ci-fmt.yml
  • .github/workflows/ci-lint.yml
  • .github/workflows/ci-redsuite.yml
  • .github/workflows/ci-test-integration.yml
  • .github/workflows/ci-test-unit.yml
  • .github/workflows/prepare-release.yml
  • .github/workflows/publish-packages.yml
  • .gitignore
  • AGENTS.md
  • Cargo.toml
  • DEFERRED_POST_DELEGATION_RESCUE_UNDELEGATION.md
  • Makefile
  • README.md
  • bins/magicblock-validator-tui/Cargo.toml
  • bins/magicblock-validator-tui/src/app.rs
  • bins/magicblock-validator-tui/src/events.rs
  • bins/magicblock-validator-tui/src/main.rs
  • bins/magicblock-validator-tui/src/state.rs
  • bins/magicblock-validator-tui/src/ui.rs
  • bins/magicblock-validator-tui/src/utils.rs
  • bins/magicblock-validator/Cargo.toml
  • bins/magicblock-validator/src/errors.rs
  • bins/magicblock-validator/src/leader.rs
  • bins/magicblock-validator/src/ledger.rs
  • bins/magicblock-validator/src/magic_sys_adapter.rs
  • bins/magicblock-validator/src/main.rs
  • bins/magicblock-verifier/Cargo.toml
  • bins/magicblock-verifier/src/main.rs
  • bins/magicblock/Cargo.toml
  • bins/magicblock/src/domain.rs
  • bins/magicblock/src/main.rs
  • clippy.toml
  • config.example.toml
  • config.verifier.example.toml
  • docs/architecture.md
  • docs/sysvars.md
  • docs/tui-externalization.md
  • gt.md
  • magicblock-account-cloner/Cargo.toml
  • magicblock-account-cloner/README.md
  • magicblock-account-cloner/src/lib.rs
  • magicblock-account-cloner/src/util.rs
  • magicblock-accounts-db/Cargo.toml
  • magicblock-accounts-db/README.md
  • magicblock-accounts-db/src/error.rs
  • magicblock-accounts-db/src/index.rs
  • magicblock-accounts-db/src/index/iterator.rs
  • magicblock-accounts-db/src/index/table.rs
  • magicblock-accounts-db/src/index/tests.rs
  • magicblock-accounts-db/src/index/utils.rs
  • magicblock-accounts-db/src/lib.rs
  • magicblock-accounts-db/src/reset.rs
  • magicblock-accounts-db/src/snapshot.rs
  • magicblock-accounts-db/src/storage.rs
  • magicblock-accounts-db/src/tests.rs
  • magicblock-accounts-db/src/traits.rs
  • magicblock-accounts/Cargo.toml
  • magicblock-accounts/README.md
  • magicblock-accounts/src/config.rs
  • magicblock-accounts/src/errors.rs
  • magicblock-accounts/src/lib.rs
  • magicblock-accounts/src/traits.rs
  • magicblock-aml/Cargo.toml
  • magicblock-aml/src/lib.rs
  • magicblock-aperture/Cargo.toml
  • magicblock-aperture/README.md
  • magicblock-aperture/src/encoder.rs
  • magicblock-aperture/src/engine_types.rs
  • magicblock-aperture/src/error.rs
  • magicblock-aperture/src/geyser.rs
  • magicblock-aperture/src/lib.rs
  • magicblock-aperture/src/processor.rs
  • magicblock-aperture/src/requests/http/get_account_info.rs
  • magicblock-aperture/src/requests/http/get_balance.rs
  • magicblock-aperture/src/requests/http/get_block.rs
  • magicblock-aperture/src/requests/http/get_block_height.rs
  • magicblock-aperture/src/requests/http/get_block_time.rs
  • magicblock-aperture/src/requests/http/get_blocks.rs
  • magicblock-aperture/src/requests/http/get_blocks_with_limit.rs
  • magicblock-aperture/src/requests/http/get_delegation_status.rs
  • magicblock-aperture/src/requests/http/get_fee_for_message.rs
  • magicblock-aperture/src/requests/http/get_latest_blockhash.rs
  • magicblock-aperture/src/requests/http/get_multiple_accounts.rs
  • magicblock-aperture/src/requests/http/get_program_accounts.rs
  • magicblock-aperture/src/requests/http/get_recent_performance_samples.rs
  • magicblock-aperture/src/requests/http/get_signature_statuses.rs
  • magicblock-aperture/src/requests/http/get_signatures_for_address.rs
  • magicblock-aperture/src/requests/http/get_slot.rs
  • magicblock-aperture/src/requests/http/get_token_account_balance.rs
  • magicblock-aperture/src/requests/http/get_token_accounts_by_delegate.rs
  • magicblock-aperture/src/requests/http/get_token_accounts_by_owner.rs
  • magicblock-aperture/src/requests/http/get_transaction.rs
  • magicblock-aperture/src/requests/http/is_blockhash_valid.rs
  • magicblock-aperture/src/requests/http/mocked.rs
  • magicblock-aperture/src/requests/http/mod.rs
  • magicblock-aperture/src/requests/http/send_transaction.rs
  • magicblock-aperture/src/requests/http/simulate_transaction.rs
  • magicblock-aperture/src/requests/http/transaction_validation.rs
  • magicblock-aperture/src/requests/mod.rs
  • magicblock-aperture/src/requests/params.rs
  • magicblock-aperture/src/requests/payload.rs
  • magicblock-aperture/src/requests/websocket/account_subscribe.rs
  • magicblock-aperture/src/requests/websocket/log_subscribe.rs
  • magicblock-aperture/src/requests/websocket/mod.rs
  • magicblock-aperture/src/requests/websocket/program_subscribe.rs
  • magicblock-aperture/src/requests/websocket/signature_subscribe.rs
  • magicblock-aperture/src/requests/websocket/slot_subscribe.rs
  • magicblock-aperture/src/server/http/dispatch.rs
  • magicblock-aperture/src/server/http/mod.rs
  • magicblock-aperture/src/server/websocket/connection.rs
  • magicblock-aperture/src/server/websocket/dispatch.rs
  • magicblock-aperture/src/server/websocket/mod.rs
  • magicblock-aperture/src/state/blocks.rs
  • magicblock-aperture/src/state/cache.rs
  • magicblock-aperture/src/state/mod.rs
  • magicblock-aperture/src/state/signatures.rs
  • magicblock-aperture/src/state/subscriptions.rs
  • magicblock-aperture/src/state/transactions.rs
  • magicblock-aperture/src/tests.rs
  • magicblock-aperture/src/utils.rs
  • magicblock-aperture/tests/accounts.rs
  • magicblock-aperture/tests/batches.rs
  • magicblock-aperture/tests/blocks.rs
  • magicblock-aperture/tests/mocked.rs
  • magicblock-aperture/tests/node.rs
  • magicblock-aperture/tests/setup.rs
  • magicblock-aperture/tests/setup/mod.rs
  • magicblock-aperture/tests/transaction_primary_mode.rs
  • magicblock-aperture/tests/transactions.rs
  • magicblock-aperture/tests/websocket.rs
  • magicblock-api/Cargo.toml
  • magicblock-api/README.md
  • magicblock-api/src/domain_registry_manager.rs
  • magicblock-api/src/fund_account.rs
  • magicblock-api/src/genesis_utils.rs
  • magicblock-api/src/lib.rs
  • magicblock-api/src/magic_validator.rs
  • magicblock-api/src/tickers.rs
  • magicblock-chainlink/Cargo.toml
  • magicblock-chainlink/src/accounts_bank.rs
  • magicblock-chainlink/src/chainlink/blacklisted_accounts.rs
  • magicblock-chainlink/src/chainlink/config.rs
  • magicblock-chainlink/src/chainlink/errors.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/ata_projection.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/delegation.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/mod.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/pending_clone_guard.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/pending_operation.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/pipeline.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/program_loader.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/tests.rs
  • magicblock-chainlink/src/chainlink/fetch_cloner/types.rs
  • magicblock-chainlink/src/chainlink/mod.rs
  • magicblock-chainlink/src/cloner/errors.rs
  • magicblock-chainlink/src/cloner/mod.rs
  • magicblock-chainlink/src/filters/noop_system_transfer.rs
  • magicblock-chainlink/src/lib.rs
  • magicblock-chainlink/src/remote_account_provider/chain_laser_actor/actor.rs
  • magicblock-chainlink/src/remote_account_provider/chain_laser_actor/mock.rs
  • magicblock-chainlink/src/remote_account_provider/chain_laser_actor/mod.rs
  • magicblock-chainlink/src/remote_account_provider/chain_laser_actor/stream_factory.rs
  • magicblock-chainlink/src/remote_account_provider/chain_laser_actor/stream_manager.rs
  • magicblock-chainlink/src/remote_account_provider/chain_laser_client.rs
  • magicblock-chainlink/src/remote_account_provider/chain_pubsub_actor.rs
  • magicblock-chainlink/src/remote_account_provider/chain_pubsub_client.rs
  • magicblock-chainlink/src/remote_account_provider/chain_slot.rs
  • magicblock-chainlink/src/remote_account_provider/chain_updates_client.rs
  • magicblock-chainlink/src/remote_account_provider/config.rs
  • magicblock-chainlink/src/remote_account_provider/errors.rs
  • magicblock-chainlink/src/remote_account_provider/lru_cache.rs
  • magicblock-chainlink/src/remote_account_provider/mod.rs
  • magicblock-chainlink/src/remote_account_provider/program_account.rs
  • magicblock-chainlink/src/remote_account_provider/pubsub_common.rs
  • magicblock-chainlink/src/remote_account_provider/pubsub_connection_pool.rs
  • magicblock-chainlink/src/remote_account_provider/remote_account.rs
  • magicblock-chainlink/src/remote_account_provider/subscribed_accounts.rs
  • magicblock-chainlink/src/remote_account_provider/subscription_reconciler.rs
  • magicblock-chainlink/src/remote_account_provider/tests.rs
  • magicblock-chainlink/src/submux/debounce_state.rs
  • magicblock-chainlink/src/submux/mod.rs
  • magicblock-chainlink/src/submux/subscribed_accounts_tracker.rs
  • magicblock-chainlink/src/submux/subscription_task.rs
  • magicblock-chainlink/src/testing/accounts.rs
  • magicblock-chainlink/src/testing/cloner_stub.rs
  • magicblock-chainlink/src/testing/context.rs
  • magicblock-chainlink/src/testing/eatas.rs
  • magicblock-chainlink/src/testing/mod.rs
  • magicblock-chainlink/src/testing/rpc_client_mock.rs
  • magicblock-chainlink/src/testing/utils.rs
  • magicblock-chainlink/tests/01_ensure-accounts.rs
  • magicblock-chainlink/tests/03_deleg_after_sub.rs
  • magicblock-chainlink/tests/04_redeleg_other_separate_slots.rs
  • magicblock-chainlink/tests/05_redeleg_other_same_slot.rs
  • magicblock-chainlink/tests/06_redeleg_us_separate_slots.rs
  • magicblock-chainlink/tests/07_redeleg_us_same_slot.rs
  • magicblock-chainlink/tests/08_subupdate-ordering.rs
  • magicblock-chainlink/tests/09_waiter_reconciliation_race.rs
  • magicblock-chainlink/tests/10_aml_undelegation.rs
  • magicblock-chainlink/tests/11_ata_eata_replace.rs
  • magicblock-chainlink/tests/12_feepayer.rs
  • magicblock-chainlink/tests/13_exceed_capacity.rs
  • magicblock-chainlink/tests/14_post_delegation_action_undelegation.rs
  • magicblock-chainlink/tests/15_multi_account_resolution.rs
  • magicblock-chainlink/tests/basics.rs
  • magicblock-chainlink/tests/utils/accounts.rs
  • magicblock-chainlink/tests/utils/logging.rs
  • magicblock-chainlink/tests/utils/mod.rs
  • magicblock-chainlink/tests/utils/test_context.rs
  • magicblock-committor-program/Cargo.toml
  • magicblock-committor-program/src/error.rs
  • magicblock-committor-program/src/processor.rs
  • magicblock-committor-service/Cargo.toml
  • magicblock-committor-service/src/committor_processor.rs
  • magicblock-committor-service/src/intent_execution_manager.rs
  • magicblock-committor-service/src/intent_execution_manager/intent_execution_engine.rs
  • magicblock-committor-service/src/intent_execution_manager/intent_scheduler.rs
  • magicblock-committor-service/src/intent_executor/error.rs
  • magicblock-committor-service/src/intent_executor/intent_execution_client.rs
  • magicblock-committor-service/src/intent_executor/intent_executor_factory.rs
  • magicblock-committor-service/src/intent_executor/mod.rs
  • magicblock-committor-service/src/intent_executor/single_stage_executor.rs
  • magicblock-committor-service/src/intent_executor/task_info_fetcher.rs
  • magicblock-committor-service/src/intent_executor/two_stage_executor.rs
  • magicblock-committor-service/src/intent_executor/utils.rs
  • magicblock-committor-service/src/persist/commit_persister.rs
  • magicblock-committor-service/src/persist/db.rs
  • magicblock-committor-service/src/service.rs
  • magicblock-committor-service/src/service/intent_client.rs
  • magicblock-committor-service/src/tasks/commit_finalize_task.rs
  • magicblock-committor-service/src/tasks/commit_stage_task.rs
  • magicblock-committor-service/src/tasks/commit_task.rs
  • magicblock-committor-service/src/tasks/intent_size_validator.rs
  • magicblock-committor-service/src/tasks/mod.rs
  • magicblock-committor-service/src/tasks/task_builder.rs
  • magicblock-committor-service/src/tasks/task_strategist.rs
  • magicblock-committor-service/src/tasks/utils.rs
  • magicblock-committor-service/src/test_utils.rs
  • magicblock-committor-service/src/transaction_preparator/delivery_preparator.rs
  • magicblock-committor-service/src/transaction_preparator/mod.rs
  • magicblock-committor-service/src/transactions.rs
  • magicblock-config/Cargo.toml
  • magicblock-config/README.md
  • magicblock-config/src/config/accounts.rs
  • magicblock-config/src/config/chain.rs
  • magicblock-config/src/config/cli.rs
  • magicblock-config/src/config/engine.rs
  • magicblock-config/src/config/ledger.rs
  • magicblock-config/src/config/mod.rs
  • magicblock-config/src/config/validator.rs
  • magicblock-config/src/consts.rs
  • magicblock-config/src/lib.rs
  • magicblock-config/src/tests.rs
  • magicblock-config/src/types/crypto.rs
  • magicblock-config/src/types/mod.rs
  • magicblock-config/src/types/network.rs
  • magicblock-core/Cargo.toml
  • magicblock-core/src/coordination_mode.rs
  • magicblock-core/src/intent/mod.rs
  • magicblock-core/src/intent/types.rs
  • magicblock-core/src/lib.rs
  • magicblock-core/src/link.rs
  • magicblock-core/src/link/accounts.rs
  • magicblock-core/src/link/blocks.rs
  • magicblock-core/src/link/replication.rs
  • magicblock-core/src/link/transactions.rs
  • magicblock-core/src/logger/mod.rs
  • magicblock-core/src/tls.rs
  • magicblock-core/src/token_programs.rs
  • magicblock-core/src/traits.rs
  • magicblock-ledger/Cargo.toml
  • magicblock-ledger/src/blockstore_processor/mod.rs
  • magicblock-ledger/src/database/cf_descriptors.rs
  • magicblock-ledger/src/database/columns.rs
  • magicblock-ledger/src/database/compaction_filter.rs
  • magicblock-ledger/src/database/db.rs
  • magicblock-ledger/src/database/ledger_column.rs
  • magicblock-ledger/src/database/rocks_db.rs
  • magicblock-ledger/src/database/rocksdb_options.rs
  • magicblock-ledger/src/ledger_truncator.rs
  • magicblock-ledger/src/lib.rs
  • magicblock-ledger/src/metrics.rs
  • magicblock-ledger/src/store/api.rs
  • magicblock-ledger/tests/common.rs
  • magicblock-ledger/tests/get_block.rs
  • magicblock-ledger/tests/test_ledger_truncator.rs
  • magicblock-magic-program-api/Cargo.toml
  • magicblock-magic-program-api/src/args.rs
  • magicblock-magic-program-api/src/compat.rs
  • magicblock-magic-program-api/src/instruction.rs
  • magicblock-magic-program-api/src/lib.rs
  • magicblock-magic-program-api/src/response.rs
  • magicblock-metrics/Cargo.toml
  • magicblock-metrics/README.md
  • magicblock-metrics/src/lib.rs
  • magicblock-metrics/src/metrics/mod.rs
  • magicblock-metrics/src/metrics/types.rs
  • magicblock-metrics/src/service.rs
  • magicblock-processor/Cargo.toml
  • magicblock-processor/README.md
  • magicblock-processor/src/builtins.rs
  • magicblock-processor/src/executor/callback.rs
  • magicblock-processor/src/executor/mod.rs
  • magicblock-processor/src/executor/processing.rs
  • magicblock-processor/src/lib.rs
  • magicblock-processor/src/loader.rs
  • magicblock-processor/src/scheduler/coordinator.rs
  • magicblock-processor/src/scheduler/locks.rs
  • magicblock-processor/src/scheduler/mod.rs
  • magicblock-processor/src/scheduler/state.rs
  • magicblock-processor/src/scheduler/tests.rs
  • magicblock-processor/tests/ephemeral_accounts.rs
  • magicblock-processor/tests/execution.rs
  • magicblock-processor/tests/fees.rs
  • magicblock-processor/tests/post_delegation_actions.rs
  • magicblock-processor/tests/replay.rs
  • magicblock-processor/tests/replica_ordering.rs
  • magicblock-processor/tests/scheduling.rs
  • magicblock-processor/tests/security.rs
  • magicblock-processor/tests/simulation.rs
  • magicblock-replicator/Cargo.toml
  • magicblock-replicator/README.md
  • magicblock-replicator/src/error.rs
  • magicblock-replicator/src/lib.rs
  • magicblock-replicator/src/nats/broker.rs
  • magicblock-replicator/src/nats/consumer.rs
  • magicblock-replicator/src/nats/lock_watcher.rs
  • magicblock-replicator/src/nats/mod.rs
  • magicblock-replicator/src/nats/producer.rs
  • magicblock-replicator/src/nats/snapshot.rs
  • magicblock-replicator/src/service/context.rs
  • magicblock-replicator/src/service/mod.rs
  • magicblock-replicator/src/service/primary.rs
  • magicblock-replicator/src/service/replica.rs
  • magicblock-replicator/src/tests.rs
  • magicblock-replicator/src/watcher.rs
  • magicblock-rpc-client/Cargo.toml
  • magicblock-rpc-client/src/lib.rs
  • magicblock-rpc-client/src/signature_confirmer.rs
  • magicblock-rpc-client/src/utils.rs
  • magicblock-runtime/Cargo.toml
  • magicblock-runtime/src/accounts.rs
  • magicblock-runtime/src/lib.rs
  • magicblock-services/Cargo.toml
  • magicblock-services/src/actions_callback_service.rs
  • magicblock-services/src/undelegation_request_service.rs
  • magicblock-table-mania/Cargo.toml
  • magicblock-table-mania/src/error.rs
  • magicblock-table-mania/src/lookup_table_rc.rs
  • magicblock-table-mania/src/manager.rs
  • magicblock-task-scheduler/Cargo.toml
  • magicblock-task-scheduler/src/db.rs
  • magicblock-task-scheduler/src/errors.rs
  • magicblock-task-scheduler/src/service.rs
  • magicblock-validator-admin/Cargo.toml
  • magicblock-validator-admin/src/claim_fees.rs
  • magicblock-validator/Cargo.toml
  • magicblock-validator/src/main.rs
  • magicblock-validator/src/shutdown.rs
  • magicblock-version/Cargo.toml
  • magicblock-version/build.rs
  • programs/elfs/guinea-keypair.json
  • programs/guinea/Cargo.toml
  • programs/guinea/src/lib.rs
  • programs/magicblock/Cargo.toml
  • programs/magicblock/src/clone_account/common.rs
  • programs/magicblock/src/clone_account/mod.rs
  • programs/magicblock/src/clone_account/process_cleanup.rs
  • programs/magicblock/src/clone_account/process_clone.rs
  • programs/magicblock/src/clone_account/process_clone_continue.rs
  • programs/magicblock/src/clone_account/process_clone_init.rs
  • programs/magicblock/src/clone_account/process_evict.rs
  • programs/magicblock/src/clone_account/process_finalize_buffer.rs
  • programs/magicblock/src/clone_account/process_finalize_v1_buffer.rs
  • programs/magicblock/src/clone_account/process_post_delegation_actions.rs
  • programs/magicblock/src/clone_account/process_set_authority.rs
  • programs/magicblock/src/clone_account/tests.rs
  • programs/magicblock/src/ephemeral_accounts/mod.rs
  • programs/magicblock/src/ephemeral_accounts/process_close.rs
  • programs/magicblock/src/ephemeral_accounts/process_create.rs
  • programs/magicblock/src/ephemeral_accounts/process_resize.rs
  • programs/magicblock/src/ephemeral_accounts/validation.rs
  • programs/magicblock/src/errors.rs
  • programs/magicblock/src/lib.rs
  • programs/magicblock/src/magic_context.rs
  • programs/magicblock/src/magic_scheduled_base_intent.rs
  • programs/magicblock/src/magic_sys.rs
  • programs/magicblock/src/magicblock_processor.rs
  • programs/magicblock/src/mutate_accounts/mod.rs
  • programs/magicblock/src/mutate_accounts/process_mutate_accounts.rs
  • programs/magicblock/src/schedule_task/mod.rs
  • programs/magicblock/src/schedule_task/process_cancel_task.rs
  • programs/magicblock/src/schedule_task/process_execute_task.rs
  • programs/magicblock/src/schedule_task/process_schedule_task.rs
  • programs/magicblock/src/schedule_transactions/mod.rs
  • programs/magicblock/src/schedule_transactions/process_accept_scheduled_commits.rs
  • programs/magicblock/src/schedule_transactions/process_add_action_callback.rs
  • programs/magicblock/src/schedule_transactions/process_execute_callback.rs
  • programs/magicblock/src/schedule_transactions/process_schedule_cloned_undelegation.rs
  • programs/magicblock/src/schedule_transactions/process_schedule_commit.rs
  • programs/magicblock/src/schedule_transactions/process_schedule_commit_tests.rs
  • programs/magicblock/src/schedule_transactions/process_schedule_intent_bundle.rs
  • programs/magicblock/src/schedule_transactions/process_scheduled_commit_sent.rs
  • programs/magicblock/src/schedule_transactions/transaction_scheduler.rs
  • programs/magicblock/src/test_utils/mod.rs
  • programs/magicblock/src/utils/account_actions.rs
  • programs/magicblock/src/utils/accounts.rs
  • programs/magicblock/src/utils/instruction_context_frames.rs
  • programs/magicblock/src/utils/instruction_sysvar.rs
  • programs/magicblock/src/utils/instruction_utils.rs
  • programs/magicblock/src/utils/mod.rs
  • programs/magicblock/src/utils/validation.rs
  • programs/magicblock/src/validator.rs
  • rust-toolchain.toml
  • rustfmt-nightly.toml
  • rustfmt.toml
  • storage-proto/Cargo.toml
  • storage-proto/build.rs
  • storage-proto/src/convert.rs
  • storage-proto/src/lib.rs
  • test-integration/Cargo.toml
  • test-integration/Makefile
  • test-integration/README.md
  • test-integration/configs/aml.devnet.toml
  • test-integration/configs/api-conf.ephem.toml
  • test-integration/configs/chainlink-conf.devnet.toml
  • test-integration/configs/claim-fees-test.toml
  • test-integration/configs/cloning-conf.devnet.toml
  • test-integration/configs/cloning-conf.ephem.toml
  • test-integration/configs/committor-conf.devnet.toml
  • test-integration/configs/config-conf.devnet.toml
  • test-integration/configs/restore-ledger-conf.devnet.toml
  • test-integration/configs/run-test-validator.sh
  • test-integration/configs/schedule-task.devnet.toml
  • test-integration/configs/schedule-task.ephem.toml
  • test-integration/configs/schedulecommit-conf-fees.ephem.toml
  • test-integration/configs/schedulecommit-conf.devnet.toml
  • test-integration/configs/schedulecommit-conf.ephem.frequent-commits.toml
  • test-integration/configs/schedulecommit-conf.ephem.toml
  • test-integration/configs/validator-offline.devnet.toml
  • test-integration/programs/flexi-counter/Cargo.toml
  • test-integration/programs/flexi-counter/Xargo.toml
  • test-integration/programs/flexi-counter/keys/f1exzKGtdeVX3d6UXZ89cY7twiNJe9S5uq84RTA4Rq4.json
  • test-integration/programs/flexi-counter/src/instruction.rs
  • test-integration/programs/flexi-counter/src/lib.rs
  • test-integration/programs/flexi-counter/src/processor.rs
  • test-integration/programs/flexi-counter/src/processor/call_handler.rs
  • test-integration/programs/flexi-counter/src/processor/callback.rs
  • test-integration/programs/flexi-counter/src/processor/schedule_intent.rs
  • test-integration/programs/flexi-counter/src/processor/transfer_intent.rs
  • test-integration/programs/flexi-counter/src/state.rs
  • test-integration/programs/flexi-counter/src/utils/asserts.rs
  • test-integration/programs/flexi-counter/src/utils/mod.rs
  • test-integration/programs/mini/Cargo.toml
  • test-integration/programs/mini/README.md
  • test-integration/programs/mini/Xargo.toml
  • test-integration/programs/mini/src/common.rs
  • test-integration/programs/mini/src/instruction.rs
  • test-integration/programs/mini/src/lib.rs
  • test-integration/programs/mini/src/processor.rs
  • test-integration/programs/mini/src/sdk.rs
  • test-integration/programs/mini/src/state.rs
  • test-integration/programs/schedulecommit-security/Cargo.toml
  • test-integration/programs/sysvars/Cargo.toml
  • test-integration/programs/sysvars/README.md
  • test-integration/programs/sysvars/sh/update
  • test-integration/programs/sysvars/src/lib.rs
  • test-integration/rust-toolchain.toml
  • test-integration/rustfmt.toml
  • test-integration/schedulecommit/README.md
  • test-integration/schedulecommit/client/Cargo.toml
  • test-integration/schedulecommit/test-scenarios/Cargo.toml
  • test-integration/schedulecommit/test-scenarios/tests/01_commits.rs
  • test-integration/schedulecommit/test-scenarios/tests/02_commit_and_undelegate.rs
  • test-integration/schedulecommit/test-scenarios/tests/03_commit_limit.rs
  • test-integration/schedulecommit/test-scenarios/tests/04_intent_size_limit.rs
  • test-integration/solana-sdk/Cargo.toml
  • test-integration/solana-sdk/src/lib.rs
  • test-integration/test-aml/Cargo.toml
  • test-integration/test-aml/src/lib.rs
  • test-integration/test-aml/tests/range_mock.rs
  • test-integration/test-chainlink/Cargo.toml
  • test-integration/test-chainlink/Makefile
  • test-integration/test-chainlink/scripts/miniv2-json-from-so.js
  • test-integration/test-chainlink/src/accounts.rs
  • test-integration/test-chainlink/src/ixtest_context.rs
  • test-integration/test-chainlink/src/lib.rs
  • test-integration/test-chainlink/src/logging.rs
  • test-integration/test-chainlink/src/programs.rs
  • test-integration/test-chainlink/src/test_context.rs
  • test-integration/test-chainlink/tests/chain_pubsub_actor.rs
  • test-integration/test-chainlink/tests/chain_pubsub_client.rs
  • test-integration/test-chainlink/tests/ix_01_ensure-accounts.rs
  • test-integration/test-chainlink/tests/ix_03_deleg_after_sub.rs
  • test-integration/test-chainlink/tests/ix_04_redeleg_other_separate_slots.rs
  • test-integration/test-chainlink/tests/ix_05_redeleg_other_same_slot.rs
  • test-integration/test-chainlink/tests/ix_06_redeleg_us_separate_slots.rs
  • test-integration/test-chainlink/tests/ix_07_redeleg_us_same_slot.rs
  • test-integration/test-chainlink/tests/ix_exceed_capacity.rs
  • test-integration/test-chainlink/tests/ix_feepayer.rs
  • test-integration/test-chainlink/tests/ix_full_scenarios.rs
  • test-integration/test-chainlink/tests/ix_programs.rs
  • test-integration/test-chainlink/tests/ix_remote_account_provider.rs
  • test-integration/test-cloning/Cargo.toml
  • test-integration/test-cloning/tests/01_program-deploy.rs
  • test-integration/test-cloning/tests/02_get_account_info.rs
  • test-integration/test-cloning/tests/03_get_multiple_accounts.rs
  • test-integration/test-cloning/tests/04_escrow_transfer.rs
  • test-integration/test-cloning/tests/05_parallel-cloning.rs
  • test-integration/test-cloning/tests/06_escrows.rs
  • test-integration/test-cloning/tests/07_subscription_limits.rs
  • test-integration/test-cloning/tests/08_multi_program_cloning.rs
  • test-integration/test-cloning/tests/10_post_delegation_token_transfer.rs
  • test-integration/test-cloning/tests/utils/mod.rs
  • test-integration/test-committor-service/Cargo.toml
  • test-integration/test-committor-service/tests/common.rs
  • test-integration/test-committor-service/tests/test_intent_executor.rs
  • test-integration/test-committor-service/tests/test_ix_commit_local.rs
  • test-integration/test-committor-service/tests/utils/instructions.rs
  • test-integration/test-committor-service/tests/utils/mod.rs
  • test-integration/test-config/Cargo.toml
  • test-integration/test-config/src/lib.rs
  • test-integration/test-config/tests/allowed_programs.rs
  • test-integration/test-config/tests/clone_config.rs
  • test-integration/test-ledger-restore/Cargo.toml
  • test-integration/test-ledger-restore/src/lib.rs
  • test-integration/test-ledger-restore/tests/00_empty_validator.rs
  • test-integration/test-ledger-restore/tests/01_single_transfer.rs
  • test-integration/test-ledger-restore/tests/02_two_transfers.rs
  • test-integration/test-ledger-restore/tests/03_single_block_tx_order.rs
  • test-integration/test-ledger-restore/tests/04_flexi_counter.rs
  • test-integration/test-ledger-restore/tests/05_program_deploy.rs
  • test-integration/test-ledger-restore/tests/06_delegated_account.rs
  • test-integration/test-ledger-restore/tests/07_commit_delegated_account.rs
  • test-integration/test-ledger-restore/tests/08_commit_update.rs
  • test-integration/test-ledger-restore/tests/09_restore_different_accounts_multiple_times.rs
  • test-integration/test-ledger-restore/tests/10_readonly_update_after.rs
  • test-integration/test-ledger-restore/tests/11_undelegate_before_restart.rs
  • test-integration/test-ledger-restore/tests/12_two_airdrops_one_after_account_flush.rs
  • test-integration/test-ledger-restore/tests/13_timestamps_match_during_replay.rs
  • test-integration/test-ledger-restore/tests/14_restore_with_new_keypair.rs
  • test-integration/test-ledger-restore/tests/15_resume_strategies.rs
  • test-integration/test-ledger-restore/tests/16_cranks_persists.rs
  • test-integration/test-magicblock-api/tests/test_domain_registry.rs
  • test-integration/test-pubsub/Cargo.toml
  • test-integration/test-pubsub/src/lib.rs
  • test-integration/test-pubsub/tests/test_account_subscribe.rs
  • test-integration/test-pubsub/tests/test_logs_subscribe.rs
  • test-integration/test-pubsub/tests/test_program_subscribe.rs
  • test-integration/test-pubsub/tests/test_signature_subscribe.rs
  • test-integration/test-pubsub/tests/test_slot_subscribe.rs
  • test-integration/test-runner/Cargo.toml
  • test-integration/test-runner/bin/run_tests.rs
  • test-integration/test-runner/src/cleanup.rs
  • test-integration/test-schedule-intent/Cargo.toml
  • test-integration/test-schedule-intent/tests/test_schedule_intents.rs
  • test-integration/test-table-mania/Cargo.toml
  • test-integration/test-table-mania/tests/ix_ensure_pubkey_table.rs
  • test-integration/test-table-mania/tests/ix_lookup_table.rs
  • test-integration/test-table-mania/tests/ix_release_pubkeys.rs
  • test-integration/test-table-mania/tests/ix_reserve_pubkeys.rs
  • test-integration/test-task-scheduler/Cargo.toml
  • test-integration/test-task-scheduler/src/lib.rs
  • test-integration/test-task-scheduler/tests/test_cancel_ongoing_task.rs
  • test-integration/test-task-scheduler/tests/test_reschedule_task.rs
  • test-integration/test-task-scheduler/tests/test_schedule_error.rs
  • test-integration/test-task-scheduler/tests/test_schedule_task.rs
  • test-integration/test-task-scheduler/tests/test_schedule_task_signed.rs
  • test-integration/test-task-scheduler/tests/test_scheduled_commits.rs
  • test-integration/test-task-scheduler/tests/test_unauthorized_reschedule.rs
  • test-integration/test-task-scheduler/tests/test_use_crank_signer.rs
  • test-integration/test-tools/Cargo.toml
  • test-integration/test-tools/src/lib.rs
  • test-integration/test-tools/src/validator.rs
  • test-integration/test-validator-services/Cargo.toml
  • test-integration/test-validator-services/src/lib.rs
  • test-integration/test-validator-services/tests/test_claim_fees.rs
  • test-integration/test-validator-services/tests/test_clocks_match.rs
  • test-integration/test-validator-services/tests/test_get_block_timestamp_stability.rs
  • test-kit/Cargo.toml
  • test-kit/src/lib.rs
  • test-kit/src/macros.rs
  • test-manual/Cargo.toml
  • test-manual/helius-laser/Cargo.toml
  • test-manual/helius-laser/configs/helius-config-template.toml
  • test-manual/helius-laser/configs/triton-config-template.toml
  • test-manual/rustfmt-nightly.toml
  • test-manual/rustfmt.toml
  • tools/genx/Cargo.toml
  • tools/genx/README.md
  • tools/genx/src/main.rs
  • tools/genx/src/test_validator.rs
  • tools/keypair-base58/Cargo.toml
  • tools/keypair-base58/README.md
  • tools/keypair-base58/src/main.rs
  • tools/ledger-stats/Cargo.toml
  • tools/ledger-stats/README.md
  • tools/ledger-stats/src/account.rs
  • tools/ledger-stats/src/accounts.rs
  • tools/ledger-stats/src/blockhash.rs
  • tools/ledger-stats/src/counts.rs
  • tools/ledger-stats/src/lib.rs
  • tools/ledger-stats/src/main.rs
  • tools/ledger-stats/src/transaction_details.rs
  • tools/ledger-stats/src/transaction_logs.rs
  • tools/ledger-stats/src/utils.rs
  • tools/magicblock-tui-client/README.md
  • tools/magicblock-tui-client/src/lib.rs
  • tools/magicblock-tui-client/src/logger.rs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

This PR replaces the Range API AML client with a thin HTTP client querying GET /risk?pubkey= and consuming server-provided isRisky results. Risk configuration, defaults, and examples now use risk_server_url; ledger-path arguments and local caching are removed. Chainlink wiring, configuration tests, mock servers, and AML integration tests are updated for the new contract.

Suggested reviewers: gabrielepicco, snawaz, thlorenz

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dode/external-risk-server

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 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 `@config.example.toml`:
- Around line 272-287: The full-coverage example config test is missing
assertions for the new Chainlink risk settings. Update
test_example_config_full_coverage in tests.rs to also verify
config.chainlink.risk.risk_server_url and config.chainlink.risk.request_timeout
alongside config.chainlink.risk.enabled, so the example file’s new values are
covered and any drift is caught. Use the existing
test_example_config_full_coverage and config.chainlink.risk fields to locate the
check.

In `@magicblock-aml/src/lib.rs`:
- Around line 43-57: `Risk::try_from_config` currently stores
`config.risk_server_url` without validation, so invalid or empty URLs only fail
later during requests. Add a parse/validation step in `try_from_config` before
constructing `Self`, and map failures to an appropriate `RiskError` so startup
fails fast. Keep the existing `Client::builder` setup and `base_url` assignment,
but ensure `RiskConfig::risk_server_url` is validated before trimming and
storing it.

In `@magicblock-chainlink/src/chainlink/errors.rs`:
- Around line 73-74: Rename the RangeRisk error variant to RiskCheckFailed in
the errors enum so it matches the new risk server naming. Update the enum
definition in the Errors/RiskError area and keep the existing #[error(...)]
message and #[from] conversion aligned with the new variant name, then fix any
references that still use RangeRisk across the Chainlink error handling code.
🪄 Autofix (Beta)

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

Run ID: 1ead3eac-31fd-40bc-b762-990a70bf8305

📥 Commits

Reviewing files that changed from the base of the PR and between 4b70fd8 and 668bfd9.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • test-integration/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • config.example.toml
  • magicblock-aml/Cargo.toml
  • magicblock-aml/src/lib.rs
  • magicblock-api/src/magic_validator.rs
  • magicblock-chainlink/src/chainlink/errors.rs
  • magicblock-chainlink/src/chainlink/mod.rs
  • magicblock-config/src/config/chain.rs
  • magicblock-config/src/consts.rs
  • magicblock-config/src/tests.rs
  • test-integration/test-aml/src/lib.rs
  • test-integration/test-chainlink/tests/ix_aml_undelegation.rs
💤 Files with no reviewable changes (2)
  • magicblock-aml/Cargo.toml
  • magicblock-api/src/magic_validator.rs

Comment thread config.example.toml
Comment thread magicblock-aml/src/lib.rs
Comment thread magicblock-chainlink/src/chainlink/errors.rs Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
config.example.toml (1)

273-277: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update stale documentation to match the new risk server architecture.

These comments still reference the deprecated "Range Risk API" and "Range API", which might cause confusion since the client and configuration have been updated to use a generic risk server.

📝 Proposed fix
-# Optional: Range Risk API validation for post-delegation actions signers
+# Optional: Risk server validation for post-delegation actions signers
 # ------------------------------------------------------------------------------
 # When enabled, all signers referenced by post-delegation actions are checked
-# against Range API before actions are allowed to execute.
+# against the risk server before actions are allowed to execute.
 [chainlink.risk]
🤖 Prompt for 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.

In `@config.example.toml` around lines 273 - 277, Update the comments above the
[chainlink.risk] configuration section to replace the deprecated “Range Risk
API” and “Range API” terminology with the current generic risk server
terminology, while preserving the documented validation behavior.
🤖 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.

Outside diff comments:
In `@config.example.toml`:
- Around line 273-277: Update the comments above the [chainlink.risk]
configuration section to replace the deprecated “Range Risk API” and “Range API”
terminology with the current generic risk server terminology, while preserving
the documented validation behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2110284f-dc0f-4102-8e7e-ffd82ab37cb6

📥 Commits

Reviewing files that changed from the base of the PR and between 668bfd9 and 07c49ef.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • test-integration/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • config.example.toml
  • magicblock-aml/src/lib.rs
  • magicblock-api/src/magic_validator.rs
  • magicblock-chainlink/src/chainlink/errors.rs
  • magicblock-chainlink/src/chainlink/mod.rs
  • magicblock-config/src/config/chain.rs
  • magicblock-config/src/consts.rs
  • magicblock-config/src/tests.rs

@Dodecahedr0x
Dodecahedr0x force-pushed the dode/external-risk-server branch from d84816f to 9e0810e Compare July 30, 2026 16:40
@Dodecahedr0x
Dodecahedr0x changed the base branch from master to engine-integration July 30, 2026 16:40
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.

feat: use an external risk checking service

2 participants