-
Notifications
You must be signed in to change notification settings - Fork 52
[WIP] remove UnixfsNode
from trickledag
#10
[WIP] remove UnixfsNode
from trickledag
#10
Conversation
UnixfsNode
from trickledagUnixfsNode
from trickledag
(small edit: added our customary |
770c69f
to
5693eb7
Compare
@bjzhang Great, let me know if you need any help or want to discuss some strategy for the append functions. |
Hey @bjzhang, do you have any other questions to help you finish this PR? We could also evaluate wrapping up here (this is already a fantastic work) and leaving the rest of the |
@schomatis Sorry. I am back. It takes me some time for OOM in a 2G box和 |
Hey @bjzhang, no rush at all, take your time, I just wanted to check that you weren't blocked here. |
NewLeafNode and NewLeafDataNode is introduced in commit 474b77a2bdb1c ("importer: remove `UnixfsNode` from the balanced builder"). It is intended to return ipfs.Node instead of UnixfsNode. But it only support creating the TFile leaf node for merkledag. This commit add fsNodeType to above two functions and update the code in dagbuild.go. Further patches of trickledag will make use of them and pass TRaw to create leaf node. License: MIT Signed-off-by: Bamvor Zhang <jian.zhang@ipfsbit.com>
After fsNodeType in NewLeafNode is supported by commit 85897b3 ("dag: add fsNodeType in NewLeafNode and NewLeafDataNode"). Move comments in NewLeafNode to importer/balanced/builder.go to clarify why TFile is used by balanced builder as leaves. License: MIT Signed-off-by: Bamvor Zhang <jian.zhang@ipfsbit.com>
This patch is the part of trickledag work which is similar to the merkledag work in commit 474b77a2bdb1c ("importer: remove `UnixfsNode` from the balanced builder"). Two helper functions(fillTrickleRecFSNode and FillFSNodeLayer) is introduced temporarily for modifing the Layout functions. These two funtions will be removed when all the code of UnixfsNode is removed in trickledag.go. Test ipfs add and get commands to check whether get the same hash of file after the code changes. License: MIT Signed-off-by: Bamvor Zhang <jian.zhang@ipfsbit.com>
5693eb7
to
25d40bb
Compare
Hi, @schomatis sorry for the very late update for my work. I update my patch for all the function in trickledag. Currently, only TestMultipleAppends fail. I have tried to understand why it fails but no progress in recent two weeks. Here is the log:
|
Hey @bjzhang, thanks for following up on this PR, I'll take a look at it during this week. |
So, I have a few pointers for some parts of the patch but I'm not finding any noticeable bug here, we'll need to take a closer look at it, the problem is definitely in the If you do a global test, Also, bringing @overbool if he's interest in taking a look here: I'm not sure if you're familiar with the trickle importer, you can read the original issue (ipfs/kubo#5135) for more context and @bjzhang can fill you in on his implementation solution (and feel to ask me any follow-up questions). |
Yes, I think so, but I do not get the clue yet.
Yes, I could see the failure in importer/trickle and mod. |
unixfs.go
Outdated
|
||
return n, nil | ||
} | ||
|
||
// NewFSNode creates a new FSNode structure with the given `dataType`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bjzhang Maybe we could wrap FSNodeFromBytes()
to implement it. I think it's pretty much the same logic asFSNodeFromBytes()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, it is a quick patch for fixing the type issue. I will update it in my next push. Thanks.
Hey @bjzhang, sorry I haven't been able to dedicate more attention to this, I'm not sure I can allocate the time needed to figure out this bug in the near future so I think the next best thing is to merge the already great work done here without the last 2 commits that are failing, we can handle the Could you move the last 2 commits to a separate PR (on top of this one) to allow me to do the final review here and merge this? |
25d40bb
to
ab44352
Compare
Hi, @schomatis For the Layout function, only 3 commits are needed. So, I force push these right now. It seems that I use the wrong size of node for Append. I will try to dig into it. And ask question later. Thanks. |
hi @schomatis I fix the test failure of trickledag last weekend. But it still failed in dagmodifier, it seems that there is some misunderstanding of size of dag in my patch. I will push new pr base on this soon. |
Great! What was the issue? Maybe it's related also to the size misunderstanding. |
I miss the Commit of FSNodeOverDag which will set data to dag. |
hi, @schomatis I push my current patch series in #54. |
Super, closing this PR then so we can focus on the other one. |
These are RFD patches which try to solve the ipfs/go-ipfs#5135 gradually. Current only Layout of trickledag is modified. I do the go test for go-unixfs package . And test ipfs add and get commands to check whether get the same hash of
file after the code changes.
I want to know if it is the right direction. Thanks.