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

TipSetCache's bug #1083

Open
cxytz01 opened this issue Oct 24, 2022 · 1 comment
Open

TipSetCache's bug #1083

cxytz01 opened this issue Oct 24, 2022 · 1 comment
Labels
kind/bug Kind: Bug

Comments

@cxytz01
Copy link
Contributor

cxytz01 commented Oct 24, 2022

Describe the bug:

I think there is a bug here.
In Watcher.init, warm function inserts the current tipset’s parents to ring buffer except for current tipset. https://github.com/filecoin-project/lily/blob/master/chain/watch/watcher.go#L112
And in watcher.index, function SetCurrent just replaces the tail of the buffer’s tipset to current tipset, the tipset that has been replaced is deleted. The tipset has been deleted has no opportunity to be indexing.

c.buffer[c.idxHead] = ts

There are the tss variable data when warm function has been executed:
tss height: 1409742
tss height: 1409741
tss height: 1409740
tss height: 1409739
tss height: 1409738
tss height: 1409737
tss height: 1409734
tss height: 1409733
tss height: 1409732
tss height: 1409731
and the current height is: 1409744
when SetCurrent function has been executed, the buffer is:
i: 0, height: 1409731
i: 1, height: 1409732
i: 2, height: 1409733
i: 3, height: 1409734
i: 4, height: 1409737
i: 5, height: 1409738
i: 6, height: 1409739
i: 7, height: 1409740
i: 8, height: 1409741
i: 9, height: 1409744
height: 1409742 was deleted.

Steps to Reproduce:

Lily Version: vx.x.x

@cxytz01 cxytz01 added the kind/bug Kind: Bug label Oct 24, 2022
@frrist
Copy link
Member

frrist commented Nov 30, 2022

@cxytz01 I suspect you are correct. Would love a PR that fixes this if you're up for it.

chihmingyang pushed a commit to chihmingyang/lily that referenced this issue Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Kind: Bug
Projects
None yet
Development

No branches or pull requests

2 participants