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

Generate L1Blocks system tx #738

Merged
merged 5 commits into from
May 11, 2024
Merged

Generate L1Blocks system tx #738

merged 5 commits into from
May 11, 2024

Conversation

icemelon
Copy link
Member

@icemelon icemelon commented May 2, 2024

1. Purpose or design rationale of this PR

Generate L1Blocks system tx

2. 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:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

3. Deployment tag versioning

Has the version in params/version.go been updated?

  • This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
  • Yes

4. Breaking change label

Does this PR have the breaking-change label?

  • This PR is not a breaking change
  • Yes

@icemelon icemelon changed the title [WIP] Generate L1Blocks system tx Generate L1Blocks system tx May 5, 2024
@icemelon icemelon marked this pull request as ready for review May 5, 2024 13:57
core/types/system_tx.go Outdated Show resolved Hide resolved
core/types/system_tx.go Show resolved Hide resolved
rollup/system_contracts/l1_blocks.go Outdated Show resolved Hide resolved
Copy link

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

looks reasonable at first pass.

Let me think a bit and do another pass later tonight, but i dont see anything wrong with it.

@icemelon
Copy link
Member Author

I'll merge this PR first to test it out. We can make changes or fixes in the subsequent prs.

@icemelon icemelon merged commit 28518b9 into l1sload May 11, 2024
6 checks passed
@icemelon icemelon deleted the gen-system-tx branch May 11, 2024 09:35
@@ -273,6 +273,18 @@ func (st *StateTransition) buyGas() error {

func (st *StateTransition) preCheck() error {
if st.msg.IsSystemTx() {
// Make sure this transaction's nonce is correct.

Choose a reason for hiding this comment

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

These checks are not needed since the nonce field was removed.

return s.scope.Track(s.l1BlocksPool.l1BlocksFeed.Subscribe(ch))
}

func (s *SyncService) CollectL1BlocksTxs(latestL1BlockNumberOnL2, maxNumTxs uint64) []*types.SystemTx {

Choose a reason for hiding this comment

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

Will this method be able to handle L2 reorgs? E.g. when we've marked some L1 blocks as included (removed from pendingL1BlocksTxs) but then some blocks are reorged.

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.

3 participants