Skip to content
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

should the constructor for the main contract appear in the dispatch table? #427

Closed
ivoysey opened this issue Feb 25, 2022 · 0 comments · Fixed by #437
Closed

should the constructor for the main contract appear in the dispatch table? #427

ivoysey opened this issue Feb 25, 2022 · 0 comments · Fixed by #437

Comments

@ivoysey
Copy link
Collaborator

ivoysey commented Feb 25, 2022

more generally, look at which transactions appear in dispatch and do a little house cleaning. see also #370, #385.

i think i can send over a sequence of transactions paired with a boolean for if they ought to appear in the table or not, from codegen to the yul ast writer.

ivoysey added a commit that referenced this issue Mar 29, 2022
)

* first pass at including default constructors

* adding a time string to the benchmarks file so it doesn't get overwritten

* updating the test script to optionally save the optimized and pretty yul from running solc, for local debugging

* generate constructor and arguments

* changing the name of the test transaction to avoid #424

* adding a prefix to constructor argument names so that they are unique

* whitespace, scala style

* writing a helper for unified names of transactions

* updating codegen to use the single helper, adding comments

* convenience script for local debugging

* updating translateTransaction to be able to use the unified helper for transaction names

* fixing whitespace

* changing the test script so that it calls transactions from main with the contract name prefix

* removing inMain boolean argument, it was a symptom of nonuniform transaction names. this addresses #407

* removing some redunant code in translateProgram, pushing helpers into util file

* fixing a silly error, changing how line comments get printed for readability

* first pass at producing the sequence of assignments for the body of the default constructor

* whitespace, scala style

* some comments, changing the signature of the internal function so i can actually use fold

* removing an accidental implementation of seq.reverse

* updating helper script

* update the field where it actually is in memory; adding a helper function because this code alsp appears in the assignment case

* using the helper to declare vars not just assign them

* adding a test specifically for default constructors

* whitespace

* another missing reverse here

* adding comments

* first cut at calling the constructor for main per #426 #427

* comment

* adding memory allocation to the invoke block, calling default constructor and tracer there. first cut

* moving the codecopy after the tracer def and call

* adding a test case

* scraps

* chainging boolean literals to be integers rather than the typed constants, per christians sugguestion

* work on storing pointers and following them in constructors

* rewrite pointers as they get copied

* whitespace, style

* adding a shorter constant

* adding a commandline flag for benchmarks, and also a check for dumping them to std out in CI

* env vars

* benchmarks in CI

* benchmarks in CI

* adding more general log comparison code

* logging updates

* scraps: changing the notion of this for the dispatch table to be the first address in storage, removing call to the tracer after new

* fussing with test definitions

* checking for storage vs memory on field loads as well as stores. comparing (x > threshold-1) so that we look in the right place for the first field in the first slot in storage

* subtracting from the threshold not the address

* without calling the trace after the constructor, we don't expect invoked logs

* this fixes a few tests

* offset into addresses in storage

* whitespace, scala style

* clean up

* adding a test case

* removing excessive gas from two tests, updating a comment per review

* trailing commas
ivoysey added a commit that referenced this issue Apr 1, 2022
* first pass at including default constructors

* adding a time string to the benchmarks file so it doesn't get overwritten

* updating the test script to optionally save the optimized and pretty yul from running solc, for local debugging

* generate constructor and arguments

* changing the name of the test transaction to avoid #424

* adding a prefix to constructor argument names so that they are unique

* whitespace, scala style

* writing a helper for unified names of transactions

* updating codegen to use the single helper, adding comments

* convenience script for local debugging

* updating translateTransaction to be able to use the unified helper for transaction names

* fixing whitespace

* changing the test script so that it calls transactions from main with the contract name prefix

* removing inMain boolean argument, it was a symptom of nonuniform transaction names. this addresses #407

* removing some redunant code in translateProgram, pushing helpers into util file

* fixing a silly error, changing how line comments get printed for readability

* first pass at producing the sequence of assignments for the body of the default constructor

* whitespace, scala style

* some comments, changing the signature of the internal function so i can actually use fold

* removing an accidental implementation of seq.reverse

* updating helper script

* update the field where it actually is in memory; adding a helper function because this code alsp appears in the assignment case

* using the helper to declare vars not just assign them

* adding a test specifically for default constructors

* whitespace

* another missing reverse here

* adding comments

* first cut at calling the constructor for main per #426 #427

* comment

* adding memory allocation to the invoke block, calling default constructor and tracer there. first cut

* moving the codecopy after the tracer def and call

* adding a test case

* scraps

* first cut at tracing after pointer write

* adding a couple new helper functions; changing the update field helper to add the storage offset, which I think breaks the SetGetDefaultChecks test.

* using new helper functions. adding tracer call code in pointer writes

* reversing a bad change, adding a comment about why so i dont feel tempted to do it again

* after debugging, changing which identifier goes to the trace call

* whitespace, comments

* Removing trace this test case. see #434
@ivoysey ivoysey linked a pull request Apr 5, 2022 that will close this issue
@ivoysey ivoysey closed this as completed Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant