Document input description and metadata output.#645
Document input description and metadata output.#645chriseth wants to merge 2 commits intoargotorg:developfrom
Conversation
|
I'm not so certain here...It seems this is adding to the cost of deployment of a contract. |
docs/using-the-compiler.rst
Outdated
| ************************************************** | ||
|
|
||
| In order to ease source code verification of complex contracts that are spread across several files, | ||
| there is a standardized for describing the relations between those files. |
|
Thanks for the comments, @zelig! One specific problem where I would like to have comments on: It should of course be possible to verify the metadata by different builds of the same compiler version (i.e. for different architectures). But this means that neither the binary hash nor the compiler version in its current form should be part of it (because that is reproduced in a different way depending on the architecture), and instead just the git commit hash. This means that the actual compiler binary can only be retrieved after a lookup inside the "compiler contract". This lookup is recommended anyway so that you do not download anything that is not even a compiler, as explained in #611, so I would not think this is a drawback. |
|
@VoR0220 The additional costs are less than 2500 gas for the data and there is the option to switch it off. One of the advantages is that everyone will automatically have an auto-generated user interface for a contract in mist. |
|
If there are no further comments, I would like to implement it like that. As there are a lot of flexibilities anyway, I don't think it is a big deal if we screw up the first version. |
|
Note: There is more flexibility in the input specification for the solidity compiler. It should be possible to change the "mode" the compiler is operating on, for example:
|
| userDocumentation: [ /* user documentation comments */ ], | ||
| developerDocumentation: [ /* developer documentation comments */ ], | ||
| natspec: [ /* natspec comments */ ] | ||
| } |
There was a problem hiding this comment.
Proposed names for the rest:
abimethodIdentifiers/functionHashesevmAssemblyevmBytecodeevmRuntimeBytecodeevmGasEstimatesevmOpcodesinterfaceorsolidityInterfacedeveloperDocumentationuserDocumenationnatspecwhy3
I'm not fully sure about source maps?
There was a problem hiding this comment.
Ignore the bytecode section as it cannot be included per your comment above.
There was a problem hiding this comment.
I am actually not sure how much to include here. As the metadata output is mainly used for source verification, you can anyway re-generate everything here by re-running the compiler.
I would only include the essential information here which are needed even in the absence of a compiler like the ones given above.
The general output format of the compiler should be a superset of the metadata output or at least largely overlapping. This general output can contain exactly the fields you mention.
There was a problem hiding this comment.
To be honest I mistook this PR for the compiler input/output and only realised after that it is for verification purposes.
Should we open a issue / PR / gist for the compiler input/output?
|
Will the compiler JSON input/output based on the metadata output? Where will the bytecode fit in? |
|
This requires a bit more discussion which moved here: https://pad.riseup.net/p/7x3G896a3NLA |
|
@chriseth updated the regular output. I think the input |
|
@chriseth is why3 going to be generated per-file basis or only a single output is given? (I would assume the latter.) |
|
@axic Why3 is currently on compiler-invocation basis, so neither contract nor file specific, and I think it will stay like that in the future. |
I mean the output generated is a single blob for every included source or there's one output blob for each input? |
|
@axic there is one output blob (just that it is not binary). Everything gets combined into a single file. |
|
I will just provide a copy of the current state of the pad to increase redundancy: |
|
suggestion by @axic: extend metadata information with a retrieve-hint. So we can always use keccak for referencing source files and also add a swarm, ipfs or github link to actually get the source. same goes for the actual metadata "file" - we should include the keccak hash plus a way to retrieve the file. |
|
I would like to propose that we add in the keys of |
|
"block deployed at" cannot be part of the metadata, because that has to be compile-time constant. The current plan is to fire a log at construction time, but the clients do not index events as well as they could be, so that might be hard to find. Perhaps we should put the "block deployed at" in the deployed bytecode in addition to firing an event. |
|
That works excellently. Lets make that happen. |
|
Continuing as #1387 |
eip-165: when the first loop hits BEGINDATA, the second loop should still run
* ✨ Receiver (argotorg#622) * ⚡📬 callback fallback * 🤏 scrunch 🤏 scrunch comments a bit * 👌 Fallback function triggered when upper 224 bits of 0x40 are mostly zero. 👌 Fallback function triggered when upper 224 bits of 0x40 are mostly zero. * ⚡ optimize / formatting ⚡ optimize / formatting * ✍️ Write some tests n stuff * ⚡ zimplify codesize * 🥢 prefer less gas * 🥢 nit that dbl comment 🥢 nit that dbl comment * 🥌 Simpler and future-proofed is also cheaper ofc * 👌 Back to known magic vals. * 📁 File into accounts * 📍 Doc acct contracts in README * 🤏 header 🤏 header * 🤏 header 🤏 header * 🪡 Stitch in comment on fallback pass cond * ✨ EIP4337 Simple Account (argotorg#623) * 🪄 EIP4337 Base Account * 📁 Make and refile into `accounts` * ⚡ Pinion owned clone base & optimize & typo nits * 🥌 Simplify and support contract signing owner * Tidy * Update README * Tidy * Optimize * Add tests * Tidy * Optimize * Tidy * Add comment * Add deposit functions * Fix * Tidy * Use gas() instead of not(0) * Edit comments * Fix comments delegatecall -> call * Use SignatureCheckerLib to validate signature * Add signature check tests * Edit tests * ✏️ Txt nits * Add delegateExecute * Add delegateExecute test * Tidy * 🏧 As in Ownable, onlyOwner functions are payable * Make initialize payable * Edit comments * Edit comments * Futureproof * Strengthen tests * Change to use Execution struct * Execution -> Call * Optimize * Optimize and strengthen tests * ✨ ERC4337: 1️⃣2️⃣7️⃣1️⃣ (argotorg#642) * 1️⃣2️⃣7️⃣1️⃣ * 🤌 Pull branch * ✔️ EOA case (1o1) use hybrid validation method * ✔️ EOA case test * 📸 snapshot * Optimize * Edit comments * Add comment * Optimize * Copypasta toEthSignedMessageHash to SignatureCheckerLib * Add delegateGuard * Add comment * Tidy * Add missing restore part of free memory pointer * 🥢 Typo nit Remove extra `be` in comment and also use `so` as coordinating conjunction removing `that`. So it's not a subordinating conjunction. * 🤏 fmt 🤏 arrange imports (libzip is w/n receiver so can come next and ++ aesthetics) and remove re-explanatory comment. * ✨ ERC4337Factory (argotorg#644) * Add ERC4337Factory * Update README * Edit comment * 🤏 Nits Nit comment and payable constructor (why not it's a factory right) * fix offset in _call() * removed funcs & add tests * ✂️ Remove unused internal func `_call` no longer used * checkStartsWithCaller -> checkStartsWith * Simplify tests --------- Co-authored-by: ross <92001561+z0r0z@users.noreply.github.com> Co-authored-by: atarpara <akpatel0618@gmail.com> Co-authored-by: 0xlgtm <simon.tan.yu.jing@gmail.com> * delegateGuard -> storageGuard * Tidy test * ✨ ERC4337 direct storage (argotorg#645) * Add test * ~ snap * assert optimizes & goes harder in storguard * mock EP receive() to match StakeManager.sol * ⚡ optimize deposit via EP receive() * ⚡ optimize balance getter w/ STL fmt * 🤏 assert -> require * Add comments and extcodesize check on addDeposit * Tidy * Move back extcodesize check to deposit functions, make entryPoint view * Snapshot --------- Co-authored-by: ross <92001561+z0r0z@users.noreply.github.com> Co-authored-by: atarpara <akpatel0618@gmail.com> Co-authored-by: 0xlgtm <simon.tan.yu.jing@gmail.com>
This is a proposal, please comment!