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

fix(share/getters): short-circuit on empty root in ShrexGetter #2846

Merged
merged 2 commits into from
Oct 16, 2023

Conversation

distractedm1nd
Copy link
Collaborator

Should fix issue where GetEDS hangs on empty data root

To test run:

celestia share get-eds “$(celestia header get-by-height 500 --node.store ~/.celestia-light-mocha-4 | jq .result)” --node.store ~/.celestia-light-mocha-4

with and without the PR

@distractedm1nd distractedm1nd added area:shares Shares and samples kind:fix Attached to bug-fixing PRs labels Oct 13, 2023
@distractedm1nd distractedm1nd self-assigned this Oct 13, 2023
@Wondertan
Copy link
Member

So I tested this on LN, and I never triggered hitting. I found though a weird behaviour. It's guaranteed that LN gets an empty block on the first time with slight delay, but it always stuck on the further tries.

@Wondertan
Copy link
Member

Note, we need to add empty block test case to our Getter test suite

@distractedm1nd
Copy link
Collaborator Author

Hmm, a swamp test of a LN calling twice resolves both times and logs hitting - I wonder what is different between swamp and the real call. Are you sure the node was running the right build?

@Wondertan
Copy link
Member

I'lol double check tmrw @distractedm1nd

@distractedm1nd
Copy link
Collaborator Author

It is logging hit for me every time, and doesn't hang ever even on multiple runs 🤔

But on main, it retrieves after the first time, logging

2023-10-16T14:05:26.436+0200	ERROR	header/p2p	p2p/exchange.go:166	verifying head received from tracked peer	{"tracked peer": "12D3KooWS7CW7y1VRuHif4nJqLyUyUtHaCFmJDEfTd9wMpgFucNk", "height": 290816, "err": "header verification failed: known header: '290816' <= current '290816'"}
2023-10-16T14:05:26.437+0200	ERROR	header/p2p	p2p/exchange.go:166	verifying head received from tracked peer	{"tracked peer": "12D3KooWHHUVwvXgdxg4k2GtfSA6yB6iDJ1fBYnvBU9LhSMzoi2A", "height": 290816, "err": "header verification failed: known header: '290816' <= current '290816'"}
2023-10-16T14:05:26.842+0200	ERROR	header/p2p	p2p/exchange.go:166	verifying head received from tracked peer	{"tracked peer": "12D3KooWQNp5N12C19cDvhDSAVLnW6tYjthZs1abi3mpXpSqwkpJ", "height": 290816, "err": "header verification failed: known header: '290816' <= current '290816'"}
2023-10-16T14:05:26.853+0200	ERROR	header/p2p	p2p/exchange.go:166	verifying head received from tracked peer	{"tracked peer": "12D3KooWHEU9efXKk5PeCyWyNVz2YYwW8bzxv25vjtfiJN6fLpTE", "height": 290816, "err": "header verification failed: known header: '290816' <= current '290816'"}

And then fails the second time.

So confirmed that this is fixing the issue

@codecov-commenter
Copy link

Codecov Report

Merging #2846 (617f823) into main (a52e2de) will increase coverage by 0.15%.
Report is 5 commits behind head on main.
The diff coverage is 25.00%.

@@            Coverage Diff             @@
##             main    #2846      +/-   ##
==========================================
+ Coverage   51.30%   51.46%   +0.15%     
==========================================
  Files         168      167       -1     
  Lines       10744    10773      +29     
==========================================
+ Hits         5512     5544      +32     
+ Misses       4750     4727      -23     
- Partials      482      502      +20     
Files Coverage Δ
share/getters/shrex.go 65.55% <25.00%> (-0.93%) ⬇️

... and 16 files with indirect coverage changes

renaynay
renaynay previously approved these changes Oct 16, 2023
@distractedm1nd distractedm1nd enabled auto-merge (squash) October 16, 2023 13:36
@distractedm1nd distractedm1nd merged commit 0b85448 into celestiaorg:main Oct 16, 2023
13 of 15 checks passed
@renaynay renaynay deleted the get-eds-shortcircuit branch October 16, 2023 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:shares Shares and samples kind:fix Attached to bug-fixing PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants