Skip to content

Updated AutomationRecordAction and added unit tests#24

Merged
aregng merged 3 commits into
feature/evm_automationfrom
supra-extensions-unit-tests
May 13, 2026
Merged

Updated AutomationRecordAction and added unit tests#24
aregng merged 3 commits into
feature/evm_automationfrom
supra-extensions-unit-tests

Conversation

@aregng
Copy link
Copy Markdown

@aregng aregng commented May 11, 2026

No description provided.

function removeRegisteredTask(uint64 _taskIndex, string memory _reason) external;

// Entry function to be called by node runtime for bookkeeping
function removeRegisteredTasks(uint64[] memory _taskIndexes, string[] memory _reasons) external;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Earlier it was discussed that multiple tasks could be passed as an argument to remove.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@udityadav-supraoracles , I think it was later decided to use single task only to avoid any failure due to execution limits due to bulk processing. (CC: @aregng )

}
pub fn process_task_indexes(mut self, task_indexes: Vec<u64>) -> Self {
self.action = Some(AutomationRecordAction::Process(task_indexes));
self.action = Some(AutomationRecordAction::process(u64::MAX, task_indexes));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@aregng , not sure I understand why u64::MAX is being passed as cycle_index parameter.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Builder itself has cycle_index optional parameter with it's corresponding setter method.
But as long as cycle index is a input of the target function, here when task indexes are set, the cycle-index in processTaskCall is initialized with MAX,and when the final transaction is built it is updated with cycle_index property of the builder.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@aregng , is there a mechanism that catches this and ensure that u64::MAX never remain in the final tx, this is error prone otherwise.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It was covered by unit tests, but I have updated the builder interface now cycle index is always specified with process or remove action parameters.

Comment thread crates/supra-extension/src/transactions/automation_record.rs Outdated
Comment thread crates/supra-extension/src/errors.rs Outdated
InvalidAutomationRecord(String),

/// Reported when automation record action can not be decoded from input bytes of the corresponding transaction
#[error("Failed to decode automation record action: {0}")]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Error string here and the option above is exactly the same, is this intended? @aregng

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated.

function removeRegisteredTask(uint64 _taskIndex, string memory _reason) external;

// Entry function to be called by node runtime for bookkeeping
function removeRegisteredTasks(uint64[] memory _taskIndexes, string[] memory _reasons) external;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@udityadav-supraoracles , I think it was later decided to use single task only to avoid any failure due to execution limits due to bulk processing. (CC: @aregng )

Aregnaz Harutyunyan and others added 2 commits May 13, 2026 11:45
- Now cycle index for automation record will be specified along with
action parameters
- Fixed property order in InitParams to match the one defined in
contract
- Added isInitialized binding to check automation registry
initialization status
@aregng aregng merged commit 1c20f3e into feature/evm_automation May 13, 2026
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.

3 participants