Fix scheduler DoS from create-vault type resolution#68
Fix scheduler DoS from create-vault type resolution#68
Conversation
PR Review: Fix scheduler DoS from create-vault type resolutionThis PR cleanly addresses the DoS vector from issue 67 by moving Security Fix AssessmentThe replacement of dynamic The atomic two-step registration via Issues and Observations1.
2. The mapping exposes the 3. Missing test: disabling a config does not affect already-PENDING requests
4. Breaking ABI changes are handled correctly
5. Gas improvement in bulk reads Changing from 6.
7. The Test Coverage
SummaryThe fix is correct and well-scoped. Main items to consider before merge:
|
Summary
Invalid Strategy Config Panicked Scheduler)CREATE_YIELDVAULTrequests with an immutablecreateVaultConfigIdregistry modelCREATE_YIELDVAULTconfigs on both Cadence and EVM in one operationWhy
The old scheduler preprocessing path could panic while validating
CREATE_YIELDVAULTrequests when a user-supplied strategy identifier resolved to a valid-looking but incompatible Cadence type. That made the scheduler vulnerable to a DoS condition even though scheduler failure is supposed to be impossible.This change removes non-total validation from the scheduler path. Scheduler preprocessing now only checks for registered create-vault config presence. Dynamic type resolution stays out of the scheduler and any bad config is isolated to registration time or worker execution.
Main Changes
createVaultConfigIdhandling forCREATE_YIELDVAULTrequests in Solidity and Cadenceregister_create_yieldvault_config_everywhere.cdcto register the same config on Cadence and EVM atomically through the worker COAValidation
forge test --match-contract FlowYieldVaultsRequestsTestflow test cadence/tests/config_registration_test.cdc cadence/tests/access_control_test.cdc cadence/tests/error_handling_test.cdc cadence/tests/evm_bridge_lifecycle_test.cdc cadence/tests/validation_test.cdcbash -n local/run_worker_tests.sh local/run_e2e_tests.sh local/run_admin_e2e_tests.sh local/testnet-e2e.sh local/deploy_full_stack.sh local/deploy_and_verify.sh