Comments (2)
I think it’s important to draw a distinction between the different reasons we would want to make pagination available. (Of course, there are also plenty of scenarios where you just need to effectively query for a particular entry, which we already have covered.) Here’s my take on the main two cases:
- consumption / usage in dapps - usually best suited to middleware like The Graph for displaying a large list, but good to be able to verify on-chain before submitting a related transaction.
- on-chain data migrations - for this it’s important that no data gets lost or skipped somehow, which makes arrays desirable, but cost also should be a consideration.
The danger in an unbounded array like we currently have is that the gas cost of memory expansion will grow too large for the function to be called at all. This is less of a concern on the factories, but will be problematic for the actual elements on the registry if we elect to track them on-chain.
The approach we decided to take with TPL and proposed for EIP-1616 was to have two methods - one for getting a count of all elements, and one for getting an element by index. This is particularly nice in our case here because the arrays are append-only, so data will be consistent on every pass through a given range. (See here for an example of what I mean.)
Another option would be to still return an array of elements, but to specify a range between two indexes. This functionality can easily be encapsulated in a wrapper at the cost of some extra overhead.
from erasure-protocol.
Need to add same getters on registry contracts, will return range of addresses.
from erasure-protocol.
Related Issues (20)
- Same-contract variable is accessed using internal scoping
- Separate all test code
- Uses of address types can be more specific
- TODO is present in code
- Variety of approaches is used for restricting actor for permission checking HOT 1
- ⚠️ Mint / burn should be explained clearly
- ⚠️ submitHash does NOT accept multihashes HOT 1
- contracts-wip should be deleted
- Unused libraries are checked into the repository
- Escrow contract stuck tokens HOT 4
- Add local subgraph to testenv package
- testenv does not create erasure_users contract
- Solidity 0.6.2 - new selector syntax
- add getter to Escrow for agreement address
- standardize version tags across all packages
- Create a full test flow that exercises all contracts/events in testenv
- bundle testenv as docker image
- Add factory deprecation switch for to registry manager
- use efficient addresses for template contracts to reduce minimal proxy size to single storage slot
- Build token forwarding contract for efficient approval chains
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from erasure-protocol.