diff --git a/cmd/integration/commands/refetence_db.go b/cmd/integration/commands/refetence_db.go index 982cc4704..255acafc1 100644 --- a/cmd/integration/commands/refetence_db.go +++ b/cmd/integration/commands/refetence_db.go @@ -359,8 +359,21 @@ func toMdbx(ctx context.Context, from, to string) error { if b.Flags&dbutils.DupSort != 0 && !b.AutoDupSortKeysConversion { appendFunc = c.(ethdb.CursorDupSort).AppendDup } + if b.Flags&dbutils.DupFixed != 0 && !b.AutoDupSortKeysConversion { + appendFunc = c.(ethdb.CursorDupSort).AppendDup + } } } + + // migrate bucket sequences to native mdbx implementation + currentID, err := srcTx.Sequence(name, 0) + if err != nil { + return err + } + _, err = dstTx.Sequence(name, currentID+1) + if err != nil { + return err + } } err := dstTx.Commit(context.Background()) diff --git a/ethdb/kv_lmdb.go b/ethdb/kv_lmdb.go index b46e0eeab..b1c5582dd 100644 --- a/ethdb/kv_lmdb.go +++ b/ethdb/kv_lmdb.go @@ -719,6 +719,10 @@ func (tx *lmdbTx) Sequence(bucket string, amount uint64) (uint64, error) { currentV = binary.BigEndian.Uint64(v) } + if amount == 0 { + return currentV, nil + } + newVBytes := make([]byte, 8) binary.BigEndian.PutUint64(newVBytes, currentV+amount) err = c.Put([]byte(bucket), newVBytes)