You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/madr/1-intial.md
+84-26
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Asset resolution by way of an ANT Registry
1
+
# An event driven ANT registration system in AO to optimize ANT listings by access role
2
2
3
3
- Status: accepted
4
4
- Deciders: [Dylan], [Ariel], [Phil]
@@ -7,7 +7,32 @@
7
7
8
8
## Context and Problem Statement
9
9
10
-
Performance of loading a user’s registered name is slow with the current method of loading all of the ArNS ecosystem (all ArNS names and ANTs registered to them). There is no way to quickly identify ownership of an ANT, let alone any AO process.
10
+
Listing all ANTs registered to ArNS names and owned by a specific owner or
11
+
owners becomes more computationally expensive as more ArNS names are registered.
12
+
Additionally, its computationally infeasible to find ANTs not registered to an
13
+
ArNS. GraphQL-based approaches cannot currently support either of these
14
+
scenarios.
15
+
16
+
We need to provide owner-based lookups that perform better than O(N).
17
+
18
+
This is done both on the client side via [AoConnect], or as inter-process
19
+
communication (like in the [ArNS Resolver](#arns-resolver)).
20
+
21
+
### Additional Background
22
+
23
+
The ArNS AO Process is responsible for recording which ANTs are registered to
24
+
each ArNS name. It does not store or track additional information about the
25
+
owner of the ANT. This reduces the amount of state managed, providing more
26
+
concurrency in the operations in the overall name system's design, (e.g.
27
+
individual ANT's activities do not impact performance of the ArNS Process).
28
+
29
+
The downside of this separation is that listing all the ANTs for any owner is
30
+
computationally expensive. You need to retrieve every ArNS record and perform a
31
+
lookup of each associated ANT's owner, then filter the resulting owner map by
32
+
the owner(s) in question - an O(N) operation where N is the total number of
33
+
registered names. An additional downside is that unregistered (from an ArNS
34
+
perspective) ANTs that one owns are not discoverable via this expensive
35
+
algorithm.
11
36
12
37
## Decision Drivers
13
38
@@ -18,78 +43,111 @@ The main drivers for this decision revolve around:
18
43
-**Scalability**
19
44
- We cannot load the entire ArNS ecosystem client-side if it grows.
20
45
-**Ecosystem Integrations**
21
-
- Having this utility process solely for ANT contract indexing provides integration points for other applications and reduces our reliance on other teams/products (e.g., Bazar profile processes).
46
+
- Having this utility process solely for ANT contract indexing provides
47
+
integration points for other applications and reduces our reliance on other
48
+
teams/products (e.g., Bazar profile processes).
22
49
-**Maintainability**
23
50
- Since we control the registry process, we can drive its maintenance.
24
51
25
52
## Considered Options
26
53
27
-
### ANT Registry
54
+
### Dedicated ANT Registry Process
55
+
56
+
An AO Process that allows for permissionless reporting of the existence of ANTs
57
+
by their Process ID that is capable of asynchronously, by way of AO messaging,
58
+
retrieving, or being notified about, and then caching indexable information
59
+
about ANTs, namely their owners and Controllers.
28
60
29
61
-**Pros:**
30
62
- Dedicated registry for ANTs.
31
63
- Event-driven updates from ANTs.
32
-
- Separate state and compute from the resolver process.
64
+
- Separate state and compute from the resolver process, thus preserving system
65
+
concurrency while providing for better UX in the system.
66
+
-**Can support permissionless registration, thus allowing us to pre-register
67
+
every ANT we've previously created during our migration to AO AND allowing
68
+
3rd party Processes to create and register ANTs on behalf of users.**
33
69
-**Cons:**
34
70
- Additional maintenance required.
71
+
- Permissionlessness may invite spamming or DOSing
72
+
- Gas management requirements since the ANT Registry will have to send
73
+
messages to ANT processes
35
74
36
-
### ArNS Resolver
75
+
### Polling-based ArNS Resolver
76
+
77
+
The ArNS Resolver is an AOS process that acts as an indexer for the entire ArNS
78
+
ecosystem - it tracks owner and controller relationship by maintaining a state
79
+
of all ANTs registered to ArNS names, thereby allowing efficient lookups of
80
+
relational data from a central process.
37
81
38
82
-**Pros:**
39
83
- Capable of resolving records and ANTs.
40
84
-**Cons:**
41
-
- Does not resolve ANTs that are not registered.
85
+
-**Does not resolve ANTs that are not registered.**
42
86
- Complexity increases with integration of ANT updates.
87
+
- Performs unnecessary work for ANTs that have not changed
88
+
-**Potentially shoulders all the gas burden for fetching ANT information**
43
89
44
90
### Adding Ownership Info to the Network Process
45
91
92
+
This would entail updates to the Network Process, either to make it so the ANT
93
+
associated with an ArNS name can send it a state update (like the pattern the
94
+
[ANT Registry](#dedicated-ant-registry-process) implements) on role changes (eg
95
+
ANT is transferred or a controller is added to it), or removing said role
96
+
changes from happening on the ANT and applying those handlers to the Network
97
+
process to allow the owner of the domain to manage those fields directly on the
98
+
Network process.
99
+
46
100
-**Pros:**
47
101
- Centralized control.
48
102
-**Cons:**
49
103
- Increases complexity of the Network process.
50
-
- Reduces flexibility of ANT processes.
104
+
-**Reduces flexibility of ANT processes.**
105
+
-**Massively increases computational load and process memory - i.e. reduction
106
+
in system concurrency**
51
107
52
108
### Bazar Profile Processes and Profile Registry
53
109
110
+
[Bazar Profiles] are AOS processes that implement asset tracking and account abstraction,
111
+
whereby the profile itself owns the assets it is tracking, and the profile is owned
112
+
by the user. This allows for event driven portfolio management. The Profile Registry
113
+
is a similar organism to the ANT Registry, therein tracking existing profiles that
114
+
register themselves to at, allowing for profile discovery by user address.
115
+
54
116
-**Pros:**
55
117
- Promising technology.
56
118
- Future integration potential.
57
119
-**Cons:**
58
-
- Currently in rapid development.
120
+
-**Currently in rapid development.**
59
121
- Managed by another team.
60
122
- Complicates ownership resolution due to account abstraction.
61
123
62
124
## Decision Outcome
63
125
64
-
It was decided to use an ANT registry due to the following downsides of other avenues:
65
-
66
-
#### ArNS Resolver
67
-
68
-
The ArNS Resolver interacts with the Network contract and is capable of resolving the records as well as the ANTs; however, it does not resolve ANTs that are not registered, only those that are registered. The ANT registry can implement event-driven updates from ANTs while separating the state and compute from the resolver process.
69
-
70
-
#### Adding Ownership Info to the Network Process
71
-
72
-
Part of the point of using the ANT processes for ownership control is to keep the state separated from the Network process. Adding this to the Network process would add complexity and reduce the flexibility of ANTs.
73
-
74
-
#### Bazar Profile Processes and Profile Registry
75
-
76
-
This tech is promising but still quite young and in rapid development at the time of writing, in the hands of another team making the architectural decisions. The profile process workflow is also an account abstraction, complicating the ownership resolution. With the ANT Registry, we should still be able to integrate with the profile processes in the future (since profile processes are, in fact, the owner of their listed assets).
126
+
After weighing the pros and cons, it was decided to use an
127
+
[ANT registry](#dedicated-ant-registry-process).
77
128
78
129
### Positive Consequences
79
130
80
-
- Asset discovery will be optimized, allowing easy querying for users' assets, specifically ANT processes, which can then be used to retrieve owned domains from the network process.
131
+
- Asset discovery will be optimized, allowing easy querying for users' assets,
132
+
specifically ANT processes, which can then be used to retrieve owned domains
133
+
from the network process.
81
134
82
135
### Negative Consequences
83
136
84
-
- Maintenance: It is another process for us to maintain, though it seems necessary.
85
-
- Future Redundancy: The problem this is solving may be solved in the future by more ecosystem-wide projects (e.g., Bazar profiles), making this redundant.
137
+
- Maintenance: It is another process for us to maintain, though it seems
138
+
necessary.
139
+
- Future Redundancy: The problem this is solving may be solved in the future by
140
+
more ecosystem-wide projects (e.g., Bazar profiles), making this redundant.
Copy file name to clipboardexpand all lines: docs/madr/2-sqlite.md
+34-25
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Using aos-sqlite Module
1
+
# Using aos-sqlite to manage data registered in the ANT Registry Process
2
2
3
3
- Status: proposed
4
4
- Deciders: [Dylan], [Ariel], [Phil]
@@ -7,18 +7,28 @@
7
7
8
8
## Context and Problem Statement
9
9
10
-
The `aos-sqlite` module is a WebAssembly (Wasm) binary in the Arweave (ao) ecosystem that extends the functionality of the standard `aos` Wasm binary module. The `aos` module includes an `Eval` handler that consumes Lua strings and uses the `load` method of Lua to execute them. The `aos-sqlite` module is compiled with `lua-sqlite3` from C to Wasm, providing additional SQLite functionality. Given that directly using tables has demonstrated scalability issues, the SQLite implementation offers a potential solution. However, due to its novelty in the ecosystem, there are concerns about its stability in larger products. Therefore, using it here for the ANT Registry provides a suitable environment seperate from other products to test its stability.
10
+
The `aos-sqlite` module, is a WebAssembly (Wasm) binary in the Arweave (ao)
11
+
ecosystem, and extends the standard `aos` Wasm module. The `aos` module includes
12
+
an `Eval` handler that executes Lua strings using the `load` method of the
13
+
stdlib in Lua. The `aos-sqlite` module, compiled with `lua-sqlite3` from C to
14
+
Wasm, adds SQLite functionality.
15
+
16
+
Directly using Lua tables has shown a need for better tooling in manipulating
17
+
and searching data, making the SQLite implementation a potential solution.
18
+
However, its novelty raises concerns about reliability in larger products.
11
19
12
20
## Decision Drivers
13
21
14
22
The main drivers for this decision are:
15
23
16
24
-**Scalability**
17
-
- The current method of using tables has scalability issues that SQLite can potentially address.
25
+
- The current method of using tables has scalability issues that SQLite can
26
+
potentially address.
18
27
-**Performance**
19
28
- Improved performance in handling larger datasets with SQLite.
20
29
-**Risk Management**
21
-
- Mitigating risks in larger products by testing the module in a controlled environment first.
30
+
- Mitigating risks in larger products by testing the module in a controlled
31
+
environment first.
22
32
-**Ecosystem Integration**
23
33
- Exploring new modules and their potential benefits within the ao ecosystem.
24
34
@@ -30,51 +40,50 @@ The main drivers for this decision are:
30
40
- Known and stable.
31
41
- No need for additional testing or integration.
32
42
-**Cons:**
33
-
- Demonstrated scalability issues.
43
+
- Demonstrated scalability issues when attempting to retrieve 150k records in
44
+
ANT's.
34
45
- Limited performance with larger datasets.
35
-
- Lack of strictness on data types
46
+
- Lack of strictness on data types.
36
47
37
48
### Option 2: Use aos-sqlite Module
38
49
39
50
-**Pros:**
40
51
- Addresses scalability issues with direct table usage.
41
52
- Potential for improved performance with larger datasets.
42
53
- Maintained by core team of AO
54
+
- Additional flexibility in the ways we can store and query for data
43
55
-**Cons:**
44
56
- New and relatively untested in the ecosystem.
45
57
- Potential stability issues in larger products.
46
58
47
59
## Decision Outcome
48
60
49
-
It was decided to use the `aos-sqlite` module to address scalability issues in a controlled environment. This approach allows us to test its effectiveness and performance before considering wider adoption in larger products.
50
-
51
-
### Implementation Details
52
-
53
-
#### aos-sqlite Module
54
-
55
-
-**Functionality:** Extends the `aos` module with SQLite functionality, compiled with `lua-sqlite3` from C to Wasm.
56
-
-**Handler:** Includes an `Eval` handler that consumes Lua strings and executes them using the `load` method of Lua.
57
-
58
-
#### Testing and Scalability
59
-
60
-
-**Controlled Environment:** The module will be tested in a controlled environment to assess its scalability and performance.
61
-
-**Risk Mitigation:** By testing in a smaller scope, we aim to mitigate the risks associated with its novelty and potential instability in larger products.
61
+
It was decided to use the `aos-sqlite` module to address scalability issues in
62
+
the controlled environment of the ANT Registry, since it stands apart from other
63
+
mission critical products. This approach allows us to test its effectiveness and
64
+
performance before considering wider adoption in larger products.
62
65
63
66
### Positive Consequences
64
67
65
-
-**Scalability Improvements:** Potential solution to scalability issues with direct table usage.
68
+
-**Scalability Improvements:** Potential solution to scalability issues with
0 commit comments