-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: Process Boot Loader (ECHO) #730
Comments
Note we need to add ability to init owner, so if I Spawn a process I can assign owner in boot loader |
I believe the MU logic will have to change as well to call /result on the process id |
ao Improvement Proposal 6Add Boot Loader CapabilityStatus: DRAFT AbstractCurrently at the MotivationAs a result of this, users are forced to send a SpecificationProcess AssignmentThe SU will generate an Unit BehaviormuWhen the cuThe The suWhen the Impact AnalysisWhen The AOS ScopeAll 3 unit types will be effected, as well as the specification for the aos(process.lua)
Security ConsiderationsOutstanding QuestionsSummaryAdding an |
Issue Summary: Boot Loader Implementation for AOS Process
Background
Currently, when spawning an AOS Process, the first item in the inbox is the Process Data Item, but evaluation does not occur until the first message is sent. We need to enable developers to initiate a boot loader that allows submitting data to be evaluated immediately when the client makes a GET {CU}/result/{pid} request. This request will evaluate the process, passing itself as the initial message to be evaluated and nothing else.
Problem
To act as a boot-loader, the CU must support the client's GET /result/{pid} request to trigger evaluation without receiving any other messages. This capability would allow the process to load Lua modules from a package manager or set up global states before receiving additional messages or cron jobs.
Solution Proposal
Update to
Process
DataItemSpec
if there is a new propertyOn-Boot
, the property can have a valuedata
or a TransactionId, if this is set, then the CU/Process needs to evaluate script code.or
There may be complications with Nonces; currently, the first message assigned by a SU receives a Nonce of
0
. If we cannot adjust the Nonce to treat the Process Data Item as the first (0
) message, we may need to set its nonce to-1
as the "pseudo-nonce" for the process.One potential approach (for any new processes) is to create an assignment data-item with a nonce of 0 and link it to the process, so the CU considers it the first message. This approach avoids the need to use
-1
as a nonce.The CU will then need to recognize when it is being asked to boot a process, as opposed to evaluating a message. This can be achieved by simply omitting the
process-id
query parameter typically passed to/result
when evaluating a message. If noprocess-id
is provided, then the CU will assume that the request is to boot a process and act accordingly.Affected Units
Action Items for Engineers
Evaluation Trigger on GET /result/{pid}:
Adjust Nonce Handling:
Boot Loader Capabilities:
Testing and Validation:
Feel free to reach out if there are any questions or further clarifications needed regarding this feature implementation.
The text was updated successfully, but these errors were encountered: