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

[Flow EVM] Investigate the wrong values returned by blockhash #6715

Open
m-Peter opened this issue Nov 14, 2024 · 1 comment
Open

[Flow EVM] Investigate the wrong values returned by blockhash #6715

m-Peter opened this issue Nov 14, 2024 · 1 comment
Assignees
Labels
Bug Something isn't working Flow EVM

Comments

@m-Peter
Copy link
Collaborator

m-Peter commented Nov 14, 2024

This was reported in #6552 (comment)

cc @bluesign @j1010001 I have opened this separate issue, to investigate the wrong values being returned by blockhash in Solidity contracts.

@m-Peter m-Peter added Bug Something isn't working Flow EVM labels Nov 14, 2024
@m-Peter m-Peter self-assigned this Nov 14, 2024
@bluesign
Copy link
Contributor

related code:

func (bhl *BlockHashList) Push(height uint64, bh gethCommon.Hash) error {
// handle the very first block
if bhl.IsEmpty() && height != 0 {
return fmt.Errorf("out of the order block hash, expected: 0, got: %d", height)
}
// check the block heights before pushing
if !bhl.IsEmpty() && height != bhl.height+1 {
return fmt.Errorf("out of the order block hash, expected: %d, got: %d", bhl.height+1, height)
}
// updates the block hash stored at index
err := bhl.updateBlockHashAt(bhl.tail, bh)
if err != nil {
return err
}
// update meta data
bhl.tail = (bhl.tail + 1) % bhl.capacity
bhl.height = height
if bhl.count != bhl.capacity {
bhl.count++
}
return bhl.storeMetaData()
}

my investigation so far:

  • Metadata is updating on mainnet, but buckets are not updating at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Flow EVM
Projects
None yet
Development

No branches or pull requests

2 participants