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

feat(io): add handler that forwards a Release-Name notice to the pr… #23

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

dtfiedler
Copy link
Collaborator

@dtfiedler dtfiedler commented Oct 14, 2024

…ovided IO process id

Only the owner can invoke his handler

Related PR: ar-io/ar-io-network-process#92

@@ -450,6 +452,37 @@ function ant.init()
SourceCodeTxId = srcCodeTxId
end
)

-- IO Network Contract Handlers
Handlers.add(camel("Release-Name"), utils.hasMatchingTag("Action", "Release-Name"), function(msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can add this to the action map

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah - added it, but forgot to come back and use it. b07e874

],
});

// two messages should be sent - one to the io process and one to the sender

Choose a reason for hiding this comment

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

Consider ensuring that both messages were sent and to the intended recipients.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the integration tests validate that both messages were sent. will add assertions on the target addresses of the messages

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dtfiedler dtfiedler force-pushed the PE-6656-release-name branch from bc3da70 to b07e874 Compare October 15, 2024 02:23
@dtfiedler dtfiedler changed the base branch from develop to unit-test October 15, 2024 02:24
Base automatically changed from unit-test to develop October 15, 2024 13:00
@dtfiedler dtfiedler merged commit a6b3506 into develop Oct 16, 2024
4 checks passed
@dtfiedler dtfiedler deleted the PE-6656-release-name branch October 16, 2024 18:00
dtfiedler added a commit to ar-io/ar-io-network-process that referenced this pull request Oct 23, 2024
Summary:
Introduces and `Auction` object class that is used to store auctions on
the `NameRegistry`. We should look towards using more of these classes
to leverage some better static analysis and type enforcement on
functions. The class is responsible for computing prices based on the
initialization details (baseFee, demandFactor, etc.). Auctions are
stored as instances of this class, and returned as simple table
(excluding function) so clients can compute prices themselves.

This initial implementation includes handler support for ANTs returning
`permabuy` name registrations. In a separate PR we'll introduce
Lease-Expiration-Intiated-Auctions where a name will go in to auction
after the grace period has ended.

Checklist:
- [x] business logic (and docs) to create and store auctions in state
with pricing information
- [x] handler for `Release-Name` that allows integration with ANTs
- [x] handler for `Auction-Info` to get auction information of a given
name
- [x] handler for `Auction-Bid` to submit bid to acquire name in auction
and update arns registry
- [x] unit tests with >80% coverage
- [x] integration tests for all handlers
- [x] update ANT source code to support `Release-Name` handler that
forwards to this process
    - PR: ar-io/ar-io-ant-process#23
- [x] update [ar-io-sdk](https://github.com/ar-io/ar-io-sdk) to include
auction types and APIs for auctions
    - PR: ar-io/ar-io-sdk#235
- [ ] add event data for auction creation and auction bids
- WILL DO IN A SEPARATE PR ONCE E2E TESTING IN DEVNET HAS BEEN VALIDATED

TODOs:
- [x] storing prices in auction state impacts the handler response
(`Data` ends up being an empty table - not sure if this is a bug in AO
or we are hitting a memory limit). it also costs ~600KiB to store those
values in state, which could bloat our memory when several auctions are
in process. we could consider just storing the settings of the auction
pricing in state, and use that to calculate prices when necessary (still
have to create the table, but response doesn't need to contain it). need
to think more about this and what is necessary for clients to be able to
showing pricing charts.
- we've modified to store the auction settings on the auction object,
and then clients will compute the price with various parameters

Here is the sequence diagram for a permabuy initiated auction
<img width="794" alt="image"
src="https://github.com/user-attachments/assets/8b1699e2-a764-4a7d-ad65-cafddfe66c19">
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