Open nikitosing opened 2 days ago
I can't see how we could end up with duplicate logIndex
now. But the tipset for this case is https://calibration.filfox.info/en/tipset/1775796, which is July 10th. We fixed this event index bug back in https://github.com/filecoin-project/lotus/pull/11952 which made it in to Lotus v1.27.1 which was released on June 24th, and it wasn't a mandatory upgrade.
I think what we're seeing here is pre-v1.27.1 behaviour being locked into the index, and because you're reaching back that far you're encountering the original bug that was filed for this @ https://github.com/filecoin-project/lotus/issues/11630.
Is this a problem for you @nikitosing? We'd be able to come up with some suggestions for how you might correct this, but it'd either be some gnarly SQL to run on the database, or a delete and backfill of the impacted epochs, which is only going to work if you have the full historical state to rebuild the events from.
@rvagg Yes, I think that's the case.
but it'd either be some gnarly SQL to run on the database, or a delete and backfill of the impacted epochs, which is only going to work if you have the full historical state to rebuild the events from.
it's ok, we have the full historical state
@rvagg Could you please share your suggestions about workaround for the issue?
@nikitosing can you run this, so we can see what we're dealing with? Given the path to your lotus repo dir, we want to run sqlite3
on the commandline to the sqlite/events.db
file, so something like sqlite3 /path/to/lotus/sqlite/events.db
. Then in the REPL that it gives you, run:
SELECT count(*)
FROM event e
JOIN (
SELECT tipset_key_cid, event_index
FROM event
GROUP BY tipset_key_cid, event_index
HAVING COUNT(*) > 1
) dup ON e.tipset_key_cid = dup.tipset_key_cid AND e.event_index = dup.event_index
ORDER BY e.tipset_key_cid, e.event_index;
And let me know what the number it comes back with is and we'll think about it from there.
The problem is, there was a migration in https://github.com/filecoin-project/lotus/pull/11952 that was supposed to properly order all of these so you didn't have duplicates, so I'm actually not sure how you can end up with it in a bad state like this: https://github.com/filecoin-project/lotus/pull/11952/files#diff-fe5e47a357d5465c3a2b1002977a53ad7c0990f76da22137417723577b87b19eR382
@rvagg result is 87514
Checklist
Latest release
, the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.Lotus component
Lotus Version
Repro Steps
{"jsonrpc":"2.0","id":2,"method":"eth_getTransactionReceipt","params":["0x4A2C9D4AA7BF56EA34E9E5E751BEB577C45C93D38BA825AF2B95E34EF5635350"]}
and
Describe the Bug
Expected behavior
logIndex should be unique per block and per transaction
Logging Information