Conversation
Codecov Report
@@ Coverage Diff @@
## ismail/light-mvp #352 +/- ##
===================================================
Coverage ? 61.85%
===================================================
Files ? 262
Lines ? 22930
Branches ? 0
===================================================
Hits ? 14184
Misses ? 7251
Partials ? 1495 |
p2p/ipld/read.go
Outdated
| total /= 2 | ||
| if leaf < total { | ||
| root = lnks[0].Cid | ||
| } else { | ||
| root, leaf = lnks[1].Cid, leaf-total | ||
| } |
There was a problem hiding this comment.
mind adding some documentation somewhere? doesn't have to be anything too elaborate, but I think some simple guidance would make a big difference. Particularly for readers who are not familiar with our plugin.
There was a problem hiding this comment.
Sure. Also, that’s no the final form of the PR. I think I will close ot and rewrite afresh basing on the master, but that requires #323 to be merged first.
There was a problem hiding this comment.
I added some documentation now, hope it will help understand the logic
There was a problem hiding this comment.
Cool! Just saw that after reviewing.
Use of Dag Sessions(optimization)
I think I understand this now. Although it's not clear to me how it works under the hood. But it makes sense intuitively.
This comment has been minimized.
This comment has been minimized.
96460c9 to
2b648fe
Compare
2b648fe to
e87e122
Compare
|
@liamsi, @evan-forbes, I decided not to close this PR and instead extend it with the requested changes for CoreAPI removal |
|
In follow-up PR I will go even further and will propose our custom interface for network DataAvailavility which works over DAG |
08e51ea to
631ab19
Compare
631ab19 to
0d0ab65
Compare
liamsi
left a comment
There was a problem hiding this comment.
This looks great! Left some suggestions and questions.
| "testing" | ||
| "time" | ||
|
|
||
| mdutils "github.com/ipfs/go-merkledag/test" |
There was a problem hiding this comment.
Can we use another alias? mdutils sounds like markdown utils. Suggestion: dagutils? dagtest?
There was a problem hiding this comment.
That's a default package name.
There was a problem hiding this comment.
I won't change that as that's actually temporary thing
There was a problem hiding this comment.
Later in block propagation PR instead of just Mock I will use Mock with Mock networking
There was a problem hiding this comment.
So I won't spend time for this renaming
There was a problem hiding this comment.
That's a default package name.
But what does that even mean? Is the package aliased like this in other contexts?
| // GetLeafData fetches and returns the raw leaf. | ||
| // It walks down the IPLD NMT tree until it finds the requested one. | ||
| func GetLeaf(ctx context.Context, dag format.NodeGetter, root cid.Cid, leaf, total uint32) (format.Node, error) { | ||
| // request the node | ||
| nd, err := dag.Get(ctx, root) |
There was a problem hiding this comment.
the new GetLeaf is much simpler! I like it a lot 👍
There was a problem hiding this comment.
@liamsi do we need to update ADR002 with this slight api change?
There was a problem hiding this comment.
Yeah, it would be good if the ADR would match the implementation's APIs.
There was a problem hiding this comment.
I think so, but also I am going to propose an elegant PR soon. If it's get accepted, updating this will make more sense
|
(from CI)
This is why the race detector hack was there btw. |
|
@liamsi, I guessed that removing Mock IPFS will decrease the number of goroutines to remove the hack. WIll try something else to fix that |
| t.Run(fmt.Sprintf("%s size %d", tc.name, tc.squareSize), func(t *testing.T) { | ||
| // if we're using the race detector, skip some large tests due to time and | ||
| // concurrency constraints | ||
| if racedetector.IsActive() && tc.squareSize > 8 { |
There was a problem hiding this comment.
To save you some time and to unblock this PR: we can either revert the changes regarding the racedetector, or, we simply skip all tests with a squareSize > 8.
evan-forbes
left a comment
There was a problem hiding this comment.
two 👍 from me! all of these refactors and optimizations are really adding up! ✨
|
@liamsi, @evan-forbes, after looking deeply into the reasons why the issue above happens, I conclude that we have a goroutine leak that we should fix. With that hack, we just solely ignored the issue, so I don't think taking the hack back makes sense. We must limit the amount of spawned: go sc.retrieveShare(rootCid, true, row, col, dag) |
|
I would like to handle this myself as part of this PR, but I am really tired to do that today and it is midnight my time |
|
we don't have to merge this tonight. I'll try limiting the goroutines on a separate branch and see what happens |
|
Ok, but I already pushed temporary hack to unblock this |
|
While it makes perfect sense to limit that number of go-routines spawned in that method, it's not a go-routine leak. Also note that the error only kicks in when the race-detector is active and the code works fine even with larger blocks without the race detector though. I think, we can skip that test for now for larger blocks with a note that we should limit the number of go-routines spawned (I'll open an issue). If possible, let's merge this and handle the issue in a separate PR. |
That's true! Goruitne leak is when goroutine hangs out infinitely without returning, e.g. not calling cancel() for context will introduce one. My original intuition was that spawning tonnes of routines are like leaking something. Obviously, it's wrong, affects performance, and should be avoided. Idk how to call that properly btw. |
by moving the `codecov.yml` file from .github the root folder. --- #### PR checklist - [x] Tests written/updated - [x] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments (cherry picked from commit c906604) Co-authored-by: Lasaro <lasaro@informal.systems>
by moving the `codecov.yml` file from .github the root folder. --- #### PR checklist - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments
The PR's main goal is to facilitate everything related to IPFS usage by:
DAS timings before 2 above optimizations:
DAS timings after optimizations:
NOTE: Heights in the run with optimization was not DASed before, so light-client didn't have common data before.