Skip to content

DO NOT MERGE feat: attempting to implement sideeffect counting#1646

Closed
dbanks12 wants to merge 10 commits into
masterfrom
db/attempt-ordering
Closed

DO NOT MERGE feat: attempting to implement sideeffect counting#1646
dbanks12 wants to merge 10 commits into
masterfrom
db/attempt-ordering

Conversation

@dbanks12

@dbanks12 dbanks12 commented Aug 18, 2023

Copy link
Copy Markdown
Contributor

Resolves #864
Resolves #846

Relevant to #838

Unfortunately, as I kept working on this, I realized more and more that it is far from complete. It may make sense for someone to finish this up, or it may make more sense to use it as a reference while implementing something similar but with Noir circuits.

Some notes:

  • Adds new SideEffect types which can be used to represent objects (like noteHashes) that should be paired with counters
  • Adds side-effect counters to all new notes hashes, nullifiers, read requests, call stack items
  • We should be able to get rid of the nullified_commitments array
  • I changed l2_to_l1_msgs to be SideEffects before Lasse and Leila said that is unnecessary. So that can be reverted/ignored.
  • Everything compiles (C++, TS, Noir), but there are still many failing C++ and TS tests.
    • Latest failure I was looking into is a simultor failure where a public function's new_commitments is always empty even though it has non-zero entries in PublicContext::finish()
  • There are many places in TS where we probably need to grab the proper side-effect counter from somewhere but for now I am just setting to 0
  • I was unsure whether we want to do <SideEffect>.equals(other) or <SideEffect>.value == other in some places
    • Same with <SideEffect>.isEmpty() versus <SideEffect>.value == 0

Some notes:

Checklist:

Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge.

  • If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag.
  • I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code.
  • Every change is related to the PR description.
  • I have linked this pull request to relevant issues (if any exist).

Comment on lines +323 to +329
let side_effect = SideEffectWithRange {
value: item.hash(),
start_side_effect_counter: self.inputs.side_effect_counter,
end_side_effect_counter: self.side_effect_counter,
};
self.private_call_stack.push(side_effect);
self.side_effect_counter++;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to know here how many side effects the nested private call will have and increment the counter accordingly (instead of just by 1)?

dbanks12 and others added 5 commits September 20, 2023 20:44
attempt...

Fix a lot of compilation issues, 1 pending.

Remove temp param from conditional_assign

C++ compiles.

add side effects to TS (wip)

TS compiles.
fix.

fix.

fix noir issues.

fix noir issues.

update circuits.gen.ts

Fix one more noir issue

Fix one more noir issue

fix but does not really fix my problem
@ludamad

ludamad commented Oct 11, 2023

Copy link
Copy Markdown
Collaborator

Closed as stale. Please reopen as needed.

@ludamad ludamad closed this Oct 11, 2023
@dbanks12

Copy link
Copy Markdown
Contributor Author

I'm working on this actively, but have been stuck for a while so I haven't pushed lately.

@dbanks12 dbanks12 reopened this Oct 11, 2023
@dbanks12 dbanks12 changed the title DO NOT MERGE feat: attempting to implement sideeffect counting and ordering DO NOT MERGE feat: attempting to implement sideeffect counting Oct 13, 2023
@Maddiaa0

Maddiaa0 commented Jan 8, 2024

Copy link
Copy Markdown
Member

Closed as stale

@Maddiaa0 Maddiaa0 closed this Jan 8, 2024
@dbanks12 dbanks12 deleted the db/attempt-ordering branch April 11, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

4 participants