Skip to content

allow smart contract to register automation task#356

Open
sjoshisupra wants to merge 4 commits intodevfrom
task/issue-2739
Open

allow smart contract to register automation task#356
sjoshisupra wants to merge 4 commits intodevfrom
task/issue-2739

Conversation

@sjoshisupra
Copy link
Copy Markdown

Fixes issue https://github.com/Entropy-Foundation/smr-moonshot/issues/2739

-- Add a public interface to allow smart contracts to call
-- Add native method to obtain txn_app_hash to be stored as parent_hash

@sjoshisupra sjoshisupra requested a review from aregng April 21, 2026 11:12
Copy link
Copy Markdown

@aregng aregng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General Question:
When unchecked registrations later fail during scheduling or execution what would be the expected troubleshooting approach?

_ty_args: Vec<Type>,
_args: VecDeque<Value>,
) -> SafeNativeResult<SmallVec<[Value; 1]>> {
// Guard against binary/framework version mismatch: if the node binary does not yet include
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If binary does not include the native function then any attempt of the call from contract's context will fail and will not reach this point at all. The comment above is missleading.

This if condition simply double checks that this function can be called only if automation v2.1 feature is enabled.

automation_fee_cap_for_epoch: u64,
aux_data: vector<vector<u8>>
) acquires AutomationRegistryV2, AutomationCycleDetails, ActiveAutomationRegistryConfigV2, AutomationRefundBookkeeping {
assert!(features::supra_automation_v2_1_enabled(), EDISABLED_AUTOMATION_FEATURE);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDISABLED_AUTOMATION_FEATURE error is reported if in general automation feature is not enabled.
Either the error message should be updated to make it more generic, or dedicated error code should be introduced for this case.
In UX point of view dedicated error code is preferable.

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.

2 participants