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

feat(contacts): use bitmap for skipped messages #893

Merged
merged 8 commits into from Sep 7, 2023

Conversation

zimpha
Copy link
Member

@zimpha zimpha commented Aug 31, 2023

Purpose or design rationale of this PR

This PR use a bitmap to keep track the status of skipped and dropped messages. It shall save a lot of gas compared to previous method.

Why previous method failed?

Gas Refunds

Some opcodes can trigger gas refunds, which reduces the gas cost of a transaction. Gas refunds are applied at the end of a transaction. If a transaction has insufficient gas to reach the end of its run, its gas refund cannot not be triggered, and the transaction fails. With the introduction of the London hardfork, two aspects of gas refunds changed. First, the limit to how much gas can be refunded is lowered from half of the total transaction cost, to one fifth of the total transaction cost. Second, the SELFDESTRUCT opcode cannot trigger gas refunds, only SSTORE.

PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • feat: A new feature

Deployment tag versioning

Has tag in common/version.go been updated?

  • No, this PR doesn't involve a new deployment, git tag, docker image tag
  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change
  • Yes

@github-actions
Copy link

github-actions bot commented Aug 31, 2023

LCOV of commit f8b9da0 during Contracts #1358

Summary coverage rate:
  lines......: 52.9% (1003 of 1896 lines)
  functions..: 67.6% (225 of 333 functions)
  branches...: no data found

Files changed coverage rate: n/a

contracts/src/L1/rollup/L1MessageQueue.sol Outdated Show resolved Hide resolved
contracts/src/L1/rollup/L1MessageQueue.sol Outdated Show resolved Hide resolved
contracts/src/L1/rollup/L1MessageQueue.sol Outdated Show resolved Hide resolved
contracts/src/L1/rollup/L1MessageQueue.sol Outdated Show resolved Hide resolved
contracts/src/L1/rollup/L1MessageQueue.sol Show resolved Hide resolved
@zimpha zimpha merged commit 7559dc4 into develop Sep 7, 2023
3 checks passed
@zimpha zimpha deleted the feat/use_bitmap_for_skipped_message branch September 7, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants