Skip to content

[Bug] incorrect implementation of DeleteForkIdBlock(fromBlockNo, toBlockNo uint64) #1939

@dloghin

Description

@dloghin

The issues is here: https://github.com/0xPolygonHermez/cdk-erigon/blob/7197af7e7f1c4d82de882efbc792d6de56dde4cc/zk/hermez_db/db.go#L1111

func (db *HermezDb) DeleteForkIdBlock(fromBlockNo, toBlockNo uint64) error should delete <forkId, blkNum> records where the key is fork id, but it calls db.deleteFromBucketWithUintKeysRange(FORKID_BLOCK, fromBlockNo, toBlockNo) which uses block number as key.

The logic should be changed such that records with block number in the range [fromBlockNo, toBlockNo] are deleted or updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions