-
Notifications
You must be signed in to change notification settings - Fork 0
[EAN-Issue-2529] Added automation and block metadata transactions #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/automation_registry
Are you sure you want to change the base?
Conversation
… use it in other places
…e_to_revm Add tx hash precompile to revm at 0x53555001
2fe1214 to
b0a99a9
Compare
5b3a60f to
551af95
Compare
- If needed it should be enabled and generated manually
eb74788 to
a5512d6
Compare
| pub fn is_supra_reserved(address: &Address) -> bool { | ||
| SUPRA_RESERVED_ADDRESSES.contains(address) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am guessing this would be changed based on our discussion that prefix comparision would be faster.
| VM_SIGNER = SUPRA_RESERVED_ADDRESSES[0], | ||
| "Supra Reserved address Precompile address to retrieve transaction hash", | ||
| TX_HASH_ADDRESS = SUPRA_RESERVED_ADDRESSES[1], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are not going to generate SUPRA_RESERVED_ADDRESSES for now, may be this can be directly be defned as corresponding const value?
| interface SupraContractsBindings { | ||
| function blockPrologue() external; | ||
| function getAllActiveTaskIds() external view returns (uint256[] memory); | ||
| function getCycleInfo() external view returns (uint64, uint64, uint64, CommonUtils.CycleState); | ||
| function getTaskDetails(uint64 _taskIndex) external view returns (CommonUtils.TaskDetails memory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just wondering, are you able to call registry methods from here or not? Does alloy provide necessary API to be able to do so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is my hope so, just need to investigate the apis more thorough to have the definite answer.
| const SIGNATURE: &'static str = "getAllActiveTaskIds()"; | ||
| const SELECTOR: [u8; 4] = [197u8, 220u8, 246u8, 172u8]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean you are indeed able to make a call from Rust layer to solidity methods?
| pub struct AutomatedTransactionDetails { | ||
| /// Transaction details | ||
| pub txn: AutomatedTransaction, | ||
| /// Priority of the automated transaction to be scheduled. | ||
| /// The low value indicates higher priority. | ||
| pub priority: u64, | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Move, since the contract was already deployed, we had to define another struct to be able to add new fields. But in Solidity we don't hve to do that. It means that Solidity can perhaps have a single struct encompassing all required fields, including priority (cc: @udityadav-supraoracles @aregng ) and therefore the Rust interface also may have a single big struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dr @sjoshisupra, this is already AutomatedTransaction which is created based on the automation TaskDetails. When TaskDetails is updated to have priority as separate property, the rust counterpart representation will be updated accordingly/automatically.
Here priority is separate for AutomatedTransaction because it will be only used to schedule the transaction based on its priority, during the execution it will not play any role, so it is not included in AutomatedTransaction
| #[inline] | ||
| fn gas_price(&self) -> Option<u128> { | ||
| None | ||
| } | ||
|
|
||
| #[inline] | ||
| fn max_fee_per_gas(&self) -> u128 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between gas_price and max_fee_per_gas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The meaning of them is the same but based on the transaction eip type only one of them is present TxEip1559&TxEip7702 have max_fee_per_gas, Legacy&TxEip2930 have gas-price
No description provided.