Comments (2)
I really like this idea, removing those queues would simplify things a lot. My main concern is the gas cost, but I can give it a try and compare.
About the other downsides, I hope with work around them, worst case we could still enforce that drafting occurs within the term.
from aragon-court.
Some numbers from my first tests:
Gas comparison
inserts one node
Without Checkpointing | With Checkpointing |
---|---|
Tree depth: 1
Tree next key: 1 |
Tree depth: 1
Tree next key: 1 |
inserts a few consecutive nodes
Without Checkpointing | With Checkpointing | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tree depth: 3
Tree next key: 270
Sortition 2605 gas: 27,299 |
Tree depth: 3
Tree next key: 270
Sortition 2605 gas: 34,011 |
lots of activity
Without Checkpointing | With Checkpointing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tree depth: 3
Tree next key: 2,304
Removes
Sortitions
|
Tree depth: 3
Tree next key: 2,304
Removes
Sortitions
|
lots of activity, batched
Without Checkpointing | With Checkpointing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tree depth: 4
Tree next key: 4,160
Removes
Sortitions
|
Tree depth: 4
Tree next key: 4,160
Removes
Sortitions
|
forcing (fake) big tree
Without Checkpointing | With Checkpointing | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tree depth: 8
Tree next key: 268,435,726
Sortition 2605 gas: 30,907 |
Tree depth: 8
Tree next key: 268,435,726
Sortition 2605 gas: 42,113 |
inserts a lot of times into the first node
Without Checkpointing | With Checkpointing | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tree depth: 1
Tree next key: 1
Sortition 0 gas: 23,501 |
Tree depth: 1
Tree next key: 1
Sortitions
|
inserts a lot of times into a middle node
Without Checkpointing | With Checkpointing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tree depth: 3
Tree next key: 270
Sets
Sortition 2505 gas: 37,949 |
Tree depth: 3
Tree next key: 270
Inserts
Sortitions
|
inserts a lot of times into a all nodes of a (fake) big tree
Without Checkpointing | With Checkpointing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tree depth: 8
Tree next key: 268,435,473
Sets
Sortition 1700 gas: 35,552 |
Tree depth: 8
Tree next key: 268,435,473
Sets
Sortitions
|
multiple random sortition on a (fake) big tree with a lot of updates
Without Checkpointing | With Checkpointing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Tree depth: 6
Tree next key: 1,048,591
Sets
Sortition of 10 elements gas: 104,045 |
Tree depth: 6
Tree next key: 1,048,586
Sets
Sortitions
|
Debugging storage
Some of these numbers looked kind of weird to me, so I tried with Remix, inserting 1 or 3 nodes. For some reason, Truffle numbers were higher.
For such a small numbers, the extra storage due to the initial slot of the array has big impact. With repeated updated on a node that impact will be diluted, but the difference will be of course higher.
Without Checkpointing
One node
Three nodes
With Checkpointing
One node
Three nodes
Other considerations
- Although most of the time jurors will pay for the extra gas on updating values, it won't be the case when fees are redistributed and balances updated.
- The higher a node in the tree, the more often it will be updated. For instance, the root node will be updated every single time any balance of any juror is updated. The checkpointing array for these high nodes could grow too big.
from aragon-court.
Related Issues (20)
- Audit: Document planned Governor structure
- Audit: Use current term blocknumber for drafts
- Audit: Document usage of blockhash for randomness in trust assumptions docs
- Audit: Process deactivation requests when going through staking interface HOT 1
- Audit: Code recommendations
- Registry: Allow jurors to signal that someone else can activate on their behalf
- Voting: Allow revealing on behalf of others
- Allow to activate with pending deactivations HOT 3
- Unused imports in AragonCourt
- Dealing with evidence submission spam HOT 6
- Dealing with fluctuating gas costs HOT 1
- ANJ delegation
- Dealing with cases that goes against jurors religious beliefs HOT 3
- Value-based pricing vs flat-rate pricing
- npm: ignore `docs`, `scripts`, `test` when publishing
- Docs: Document how to interact with Aragon Court through the CLI tool
- UI/UX of buying more ANJ as a Juror HOT 1
- ARAGON COURT WEBSITE IS DOWN. HOT 1
- Subscriptions: Fix transfer to governor HOT 1
- Change location legal terms and email collection policy.
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 aragon-court.