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

Store ZKC and closing reason on batch table #1810

Closed
arnaubennassar opened this issue Mar 13, 2023 · 2 comments · Fixed by #2006
Closed

Store ZKC and closing reason on batch table #1810

arnaubennassar opened this issue Mar 13, 2023 · 2 comments · Fixed by #2006
Assignees
Milestone

Comments

@arnaubennassar
Copy link
Member

This will help analize the behaviour of the network. Note that closing reason only applies to trusted sequencer and trusted state!!

@Psykepro
Copy link
Contributor

Psykepro commented Apr 7, 2023

Steps to implement:

  • create migration file db/migrations/state/000x.sql which to add columns for each ZK Counter and the closing_reason and for closing reason to state.batch table
  • storing batch constraints 2 possible solutions:
    • on closing batch we store ZK Counters used by all txs
    • on creating a batch initializing the column values with max ZK Counters and updating on each successful tx processed the values in the columns (this case will need also update to add back the ZK Counters for each L2 Block deleted to the batch in synchronizer on L2 REORG)
  • on closing batch, we save the reason

@ToniRamirezM
Copy link
Contributor

I would consider (we can debate):

  • Use a jsonb column to store the whole ZKCounters struct
  • I would go for the first approach: easier and more performant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants