-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
don't require contracts to be deployed for computation game #117
Comments
same as #18 really, just needs to be done without excuses |
So |
Idea copied from verification game. When requesting:
|
exactly. the
i would like to dissect the problem here. there is the proof needed for the opCode at |
I think using the above Merkle tree is enough to solve both issues. We may record the values submitted and stub it in |
@johannbarbie |
@peara you are welcome to take it. you want to be gardener and worker? I scheduled a sizing meeting next wednesday, then we'll know the size |
@johannbarbie Thanks. |
Changes:
|
We also have to take opcodes like And on the plus side, we could re-use that implementation for |
@pinkiebell Thanks, I have forgotten I think we need dynamic-size leaves? As in #117 (comment), it could simplify the checking in contract. Although producing this tree could be much more complicated on client side, as the client needs to be aware of actually opcodes being run. If we use fixed-size leaves, then a Merkle proof as in Sparse Merkle tree should be enough. One can just submit the position at the same time. Although I like to use dynamic-size leaves, I may go with fixed-size leaves for now. Because distinguishing opcodes from data isn't easy and can be tricked if not don't well. |
Yes, fixed size of 32 bytes for leaf, but the length should be given in bytes not number of words.
If we use dynamic-size leaves we would save 62 bytes in the best case, that would be ~4216 in gas savings at best, correct me if I'm wrong here. |
Well the saving is more than that. Because we can do a simple compare in most case to determine the opcode and data. If we use fixed-size leaves, we need to calculate the exact position of the required opcodes or data. Not to mention the case we need to supply 3 Merkle proofs if data is spanned across 2 adjacent words. |
Just recognized that |
@peara That limit needs to specified and enforced TODO 😀 |
@pinkiebell @johannbarbie
After solver call In I think the downside of this approach is storage cost of data, which is significantly more than current approach. What do you guys think? |
How much storage that would be? Do I understand correctly that we have to save all data required for that step? |
Yes, I think so. For memory it is normally 2 bytes32, for code it is 2-3 bytes32. For callData and returnData, there are no limit 🤔 |
I fear that this could drastically raise gas cost 😨 |
Store 1 word cost is equal ~15 Merkle proofs verification cost 😕 |
After some more thinking, I think the cost can be reduce to 1 word in storage. It should be similar to how Ethereum storage works and could be used as For example, we could create a Sparse Merkle Tree from spendcond's codes.
When submitting proofs, solver will submit data of the form In this scheme, we use only 1 hashing procedure for all data from Current
For bytes32 values such as
For others such as
The main cost of this scheme should be calculating Sparse Merkle Tree. This should be similar or lower than current procedure of calculating trees for different type of data. @johannbarbie @pinkiebell What do you guys think? Notes:
|
one tree to rule them all 🤔 extending this to 256 key length wouldn't be hard. 2 things i don't understand yet:
|
how is the storage related to this proof process, btw? 🤔 |
One tree for everything sounds nice at first but how much will updates/inserts to this tree construction cost? I think this would be substantially more? |
@johannbarbie @pinkiebell |
In Or does this design change anything of this procedure? |
I see. So this would be 2 tree construction at most. |
The idea was just that we could do A sparse linked list for opcode at byte pos |
What I'm doing is https://github.com/leapdao/solEVM-enforcer/pull/137/files#diff-1aa016b76b63dd417b9159a6d65d3a32 |
Is it to replace dynamic array? I'm not so sure about memory in EVM. They won't be messed up? If so I will change to this |
Yes
As long as you make sure you update free memory pointer (if you manually allocate), if you don't use manual memory management, you should be fine. |
problem: currently the contract assume that code is deployed onchain, to be able to read the the op-code for the execution. this assumption is invalid, as explained in this diagram.
task: create a proof system giving an efficient way to provide the opcode at position of
pc
.Roles
bounty gardener: @peara / 15%
bounty worker: @peara / 60%
bounty reviewer: name / 25%
The text was updated successfully, but these errors were encountered: