Skip to content

cannot create multiple non-revertible update requests to the same public storage slot in a single TX #4736

Closed

Description

@just-mitch

Historically, if a user wrote to the same public storage slot multiple times in the same transaction, writes would be squashed such that only the most recent write would persist. This was accomplished by:

  • the simulator maintaining a map of accumulated storage update requests (see ContractStorageActionsCollector)
  • the outputs from the public kernel circuits being modified in TS to squash writes (see removeRedundantPublicDataWrites)

Note, these writes ought to be squashed by the public kernel itself. The reason this is possible without the squashing via the public kernel is that the base rollup circuit trusts that the writes it is provided are valid

However, with the introduction of non-revertible side effects, there are a few pieces of work needed to be able to write to the same public storage slot multiple times in a non-revertible manner.

  1. Expand removeRedundantPublicDataWrites to be squash writes from the non-revertible set
  2. When recombining revertible and non-revertible writes, also squash redundant writes

Activity

  1. LHerskind commented on Feb 26, 2024

    @LHerskind
    Contributor

    @just-mitch can you add some context in here? What is the issue? We haven't had any issues with updating public storage as far as I know of?

  2. changed the title [-]cannot write to public storage twice[/-] [+]cannot create multiple non-revertible update requests to the same public storage slot in a single TX[/+] on Feb 26, 2024
  3. just-mitch commented on Feb 26, 2024

    @just-mitch
    CollaboratorAuthor

    @LHerskind Just updated the comment!

  4. added a commit that references this issue on Mar 1, 2024
    30502c9
  5. moved this from Todo to Done in A3on Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions