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

fix(api): fix bug about miner.Pending call #357

Closed
wants to merge 10 commits into from

Conversation

mask-pp
Copy link

@mask-pp mask-pp commented Dec 2, 2024

Suppose the calling link contains miner/miner.go:Pending() api and txpool.Pending is not empty, then return error(ErrAnchorTxNotFound).

}
if !isAnchor {
return nil, ErrAnchorTxNotFound
if body.Transactions[0].IsAnchor() {

Choose a reason for hiding this comment

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

I remembered that the function IsAnchor() seems always to return false?
And I think using ValidateAnchorTx is enough.

Copy link
Author

Choose a reason for hiding this comment

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

It's ok if the first tx is anchor tx.

Choose a reason for hiding this comment

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

It can't happen that the first tx in the block to be finalised is not an anchor tx, can it?

Copy link
Author

@mask-pp mask-pp Dec 3, 2024

Choose a reason for hiding this comment

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

A new modification in this commit.

@mask-pp mask-pp changed the title fix(api): fix bug about eth_getBlockTransactionCountByNumber fix(api): fix bug about miner.Pending call Dec 2, 2024
}
if !isAnchor {
return nil, ErrAnchorTxNotFound
if body.Transactions[0].IsAnchor() {
Copy link
Member

Choose a reason for hiding this comment

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

The first tx in a L2 block must be an anchor tx, so no need to check this?

Copy link
Author

@mask-pp mask-pp Dec 3, 2024

Choose a reason for hiding this comment

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

A new modification in this commit.

consensus/consensus.go Outdated Show resolved Hide resolved
@davidtaikocha
Copy link
Member

Emmm is there any case we will use miner.Pending() now?

@davidtaikocha
Copy link
Member

Closed due to errors.New("pending block is not available") is expected.

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

Successfully merging this pull request may close these issues.

4 participants