-
Notifications
You must be signed in to change notification settings - Fork 6
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
[AN-Issue-1347] Implemented Automated transaction execution flow #136
Conversation
87dab4b
to
e1c46bf
Compare
dba982b
to
4dad402
Compare
aptos-move/framework/supra-framework/sources/transaction_validation.move
Outdated
Show resolved
Hide resolved
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.
@aregng , it seems that from the issue 1347 I did not see
- Chain ID check being done (if it is not done for other tx, we may not do it for automation as well)
- Check that there is a corresponding active task for this tx (each automation task would have a unique id provided by registry) and sender seems missing. If we assume however that nodes are honest I wonder if this check is required though.
assert!( | ||
timestamp::now_seconds() < txn_expiration_time, | ||
error::invalid_argument(PROLOGUE_ETRANSACTION_EXPIRED), | ||
); |
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 was under the impression that if an automation task is beyond it's expiry, the SMR layer would never include it in the set of tx to be executed. Is that still correct? Because otherwise it would result in continuous failed assert here in the prologue.
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 true, but as mentioned in my previous comment, I think each layer should validate its input and not rely on the other component correctness. If we do not agree with this approach and here we will always assume that input will not be expired, then this check can be removed.
|
69f54b6
to
7a19798
Compare
4dad402
to
4a3ce54
Compare
4a3ce54
to
f52e235
Compare
a92b1bd
to
ace749e
Compare
ab774df
to
bc106d9
Compare
aptos-move/aptos-gas-schedule/src/gas_schedule/aptos_framework.rs
Outdated
Show resolved
Hide resolved
@@ -188,6 +189,7 @@ module supra_framework::genesis { | |||
reconfiguration::initialize(&supra_framework_account); | |||
block::initialize(&supra_framework_account, epoch_interval_microsecs); | |||
state_storage::initialize(&supra_framework_account); | |||
automation_registry::initialize(&supra_framework_account); |
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 don't think we should call this here. Otherwise replay of the chain would not agree on its state. Since we have launched mainnet, this should not be touched now. automation_registry::initialize
can be called via governance script (upgrade framework followed by call to initialize)
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 testing will not be easy if we do not have initialize called here. as during testing we start the chain from genesis.
I remember you once mentioned that you want to avoid conditional initialization, but at this moment I do not see easy way to have the module initialized properly with genesis startup.
Featuer enable/disable interface might be investigated to picture and cover all scenarios.
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.
Mentioned in ticket https://github.com/Entropy-Foundation/smr-moonshot/issues/1422 to be addressed later.
@@ -437,7 +437,8 @@ spec supra_framework::stake { | |||
|
|||
spec on_new_epoch { | |||
pragma verify = false; // TODO: set because of timeout (property proved). | |||
pragma disable_invariants_in_body; | |||
// TODO: Why we need to disable invariants in body? (SUPRA) |
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 think Move prover will fail compilation if we do not have this pragma.
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.
This is not part of my change-set. it comes from this change-set f9652d1
} | ||
|
||
/// Add Multiple Keys in the Enumerable Map | ||
public fun add_value_bulk<K: copy+drop, V : store+drop+copy>( |
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 like vector::for_each
and vector::for_each_ref
, it may be helpful if we add enumerable_map::for_each_value
and enumerable_map::for_each_value_ref
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.
will be addressed in scope https://github.com/Entropy-Foundation/smr-moonshot/issues/1425 ticket
let expiration_timestamp_secs = Some(convert_timestamp_secs(std::cmp::min( | ||
at.meta.expiration_timestamp_secs.0, | ||
chrono::NaiveDateTime::MAX.timestamp() as 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.
@aregng I am not sure I quite understand what is happening here. min
of MAX
time and at.meta.expiration_timestamp_secs.0
would always result in at.meta.expiration_timestamp_secs.0
, right? Not sure what is happening here.
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.
My assumption will be that if user specified timestamp exceeds expected MAX of the chrono::NaiveDateTime::MAX.timestamp()
it will take the later one. This part might require revision as AutoamtedTransactions will never be posted by users. I need to spend more time to understand APTOS-API and how it is utilized to make sure that these changes were valid or invalid. But at this moment they do not play any role it the main automation-flow implementation.
chrono
uses i64
for timestamp and we use u64
so i64
::MAX can be potentially less than u64
value specified for expiration time.
361e3ba
to
3e787dc
Compare
Addressed, sender check is also added. |
- Added chain-id verification and task availability check by task index - Added e2e tests for AutoamtedTransaction
727fe8f
to
bf33fa8
Compare
* [AN-Issue-1347] Implemented Automated transasction execution flow * Updated automated task prologue and added e2e tests - Added chain-id verification and task availability check by task index - Added e2e tests for AutoamtedTransaction * Fixed test failure * Added task sender check in automated_transaction_prologue --------- Co-authored-by: Aregnaz Harutyunyan <>
* [AN-Issue-1347] Implemented Automated transasction execution flow * Updated automated task prologue and added e2e tests - Added chain-id verification and task availability check by task index - Added e2e tests for AutoamtedTransaction * Fixed test failure * Added task sender check in automated_transaction_prologue --------- Co-authored-by: Aregnaz Harutyunyan <>
No description provided.