Skip to content
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

fix(PE-7196): add msg.reply to all apis #72

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

atticusofsparta
Copy link
Contributor

No description provided.

["Message-Id"] = msg.Id,
})
)
ao.send(notices.addForwardedTags(msg, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

where is ao.send? and does it have the wrapper logic for using msg.reply?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/ar-io/ar-io-ant-process/pull/72/files#diff-2347104afd1b651068d7a89f9caf67ca6a1d9872d578048f8f0c4410373d3c4fR336

To be clear, this memory blowup happens not during compile time or at any other message, but rather on eval specifically, and specifically of our bundled lua.

I did investigate as to why, and it seems that adding utils.Send increases the complexity of the function call, expanding the memory it uses on the stack, causing the stack to give a memory out of bounds error - thats my theory, anyway. I think for the moment we should leave utils.Send out of this call and further investigate in another PR/SPIKE as to what options are available to us here.

The main solution - apart from not including the util - is to simply raise the stack memory. However I don't want to create a lua script that can be eval'd into one module and not another, especially since thats how our current evolve workflow works on the arns portal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As for where ao.send is, its from AOS - ao is available as a global. Its actually what utils.Send uses internally.

["Message-Id"] = msg.Id,
})
)
ao.send(notices.addForwardedTags(msg, {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ao.send(notices.addForwardedTags(msg, {
utils.Send(notices.addForwardedTags(msg, {

Recipient = Owner,
})
)
ao.send(notices.credit({
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
ao.send(notices.credit({
utils.Send(notices.credit({

Copy link
Collaborator

@dtfiedler dtfiedler left a comment

Choose a reason for hiding this comment

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

i'm not following why we have ao.send and utils.Send. please clarify.

@@ -90,6 +90,7 @@ function ant.init()
local recipient = msg.Tags.Recipient
if msg.From ~= Owner then
utils.Send(msg, {
Target = msg.From,

Choose a reason for hiding this comment

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

Would it make sense to set this in utils.Send automatically if not present rather than making it the responsibility of the caller?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it would make sense to add it there - technically its not needed for msg.reply, and we only add this because of ao.send

If we don't, we actually send an invalid message if msg.reply is not present.

Im actually wondering if we even need to wrap ao.send like this, because we KNOW what AOS module we are building. This wrapping pattern is only for backwards compatibility with older AOS process, and with our reassign-to-evolve pattern it will be a new module of our choice anyways.

Also we may not always want to "reply". Sometimes we just want to send. Using reply probably doesnt hurt, but IDK what future integrations may be influenced with these extra tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and in fact if my suspicions are correct, in that adding function calls is messing with stack memory, then we wanna be careful about that.

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