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

[Tracking Issue] Identify and throw errors for currently-unsupported (but planned) features. #1601

Closed
13 tasks done
iAmMichaelConnor opened this issue Aug 17, 2023 · 3 comments
Labels
A-ux/devex Area: relates to external ux / devex. (Users typically are devs) (See also A-internal-devex) T-tracking Type: Tracking Issue. This contains tasklists.

Comments

@iAmMichaelConnor
Copy link
Contributor

iAmMichaelConnor commented Aug 17, 2023

There are many features we would like to add, and there are many problems that we're aware of. Not all of these features can be built, nor problems resolved, before a first release.

Nevertheless, we can strive to identify unsupported features, and let the user know that they're attempting to do something which is currently unsupported, but planned. I.e. we should add code which identifies known pitfalls and gives the user a human-readable and contextual error, instead of some opaque, technical error.

This tracking issue can be an ever-growing list of such unsupported features. Each item in the list should be an issue which seeks to programmatically identify unsupported patterns, and throw an informative error in such cases.

For each case, we should assess whether the time & effort needed to identify and throw an error is more or less time than implementing the feature properly.

  • The simulator identifies contract re-entrancy.
    • If Contract A calls contract B, but later in the simulation Contract A is called by B (or C or D etc), this could cause re-entrancy errors.
    • If a private function of Contract A calls a private function of Contract A (e.g. a recursive call), the simulator should identify cases where further state changes are made after the call (because such state changes could cause state ordering errors). "State changes" includes getting, nullifying or inserting notes after the call.
    • If a public function of Contract A calls a public function of Contract A (e.g. a recursive call), the simulator should identify cases where further state changes are made after the call (because such state changes could cause state ordering errors). "State changes" includes getting, nullifying or inserting notes, and reading and writing public state, after the call.
    • Note: Contract A should still be able to make a private -> internal public call to itself, and make further private state changes after such a call.
    • The eventual fix will be to track the execution order of state transitions, logs, and enqueued function calls, but this 'ordering' work will take some time.
    • Until we do the eventual fix, we should identify this pattern and throw an error.

Document limitations

Preview Give feedback
  1. A-documentation
    jeanmon
  2. A-documentation
    dbanks12
  3. A-documentation
    suyash67

Add informative error messages

Preview Give feedback
  1. jeanmon suyash67

Tests to replicate bugs/limitations

Preview Give feedback
  1. T-bug T-testing
    spalladino
  2. T-bug T-testing
    dbanks12
  3. T-bug T-testing
    dbanks12

Working around these bugs

Preview Give feedback
  1. C-protocol-circuits
    spalladino
  2. C-protocol-circuits
    dbanks12
  3. C-protocol-circuits
    dbanks12
  4. spike
    LHerskind
  5. A-ux/devex C-aztec.nr
    dbanks12
@iAmMichaelConnor iAmMichaelConnor added T-tracking Type: Tracking Issue. This contains tasklists. A-ux/devex Area: relates to external ux / devex. (Users typically are devs) (See also A-internal-devex) labels Aug 17, 2023
@github-project-automation github-project-automation bot moved this to Todo in A3 Aug 17, 2023
@dbanks12
Copy link
Collaborator

If a private function of Contract A calls a private function of Contract A (e.g. a recursive call), the simulator should identify cases where further state changes are made after the call (because such state changes could cause state ordering errors). "State changes" includes getting, nullifying or inserting notes after the call.

After discussing with @spalladino, I don't think this is an issue that a user could experience today because while the kernel is not strict on private state ordering, the simulator is. The simulator will never let you get or nullify a note that does not exist yet.

@dbanks12
Copy link
Collaborator

If a public function of Contract A calls a public function of Contract A (e.g. a recursive call), the simulator should identify cases where further state changes are made after the call (because such state changes could cause state ordering errors). "State changes" includes getting, nullifying or inserting notes, and reading and writing public state, after the call.

I think the same is true for the simulator in public (the simulator is as strict as it needs to be), but the problem is that the public kernel does have constraints to ensure public state updates make sense in-sequence. Since the public kernel doesn't always execute things in execution order, it may think that it is enforcing proper ordering of public state updates, but what it is actually doing is rejecting a perfectly valid sequence of public state updates.

So, could we just temporarily remove the public kernel constraints that ensure a series of public state updates make sense in sequence? Maybe, but it is also the job of the final public kernel to turn the "final" state value that should be injected in the public data tree. That value must still be correct.

@iAmMichaelConnor
Copy link
Contributor Author

Closing, as all but one complete, and we can just track that one issue.

@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Oct 23, 2023
codygunton pushed a commit that referenced this issue Jan 23, 2024
* Modify dev and test rpc urls (#1600)

* Modify dev and test rpc urls

* Fixed typo

* Fixed typo

* kebab custom request method (#1601)

* revert json_rpc_provider changes

* simply forward eth node requests with fetch

* Updated dns entries for dev and testnet mainnet forks (#1603)

Co-authored-by: spypsy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ux/devex Area: relates to external ux / devex. (Users typically are devs) (See also A-internal-devex) T-tracking Type: Tracking Issue. This contains tasklists.
Projects
Archived in project
Development

No branches or pull requests

2 participants