-
Notifications
You must be signed in to change notification settings - Fork 33
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
Switch to lazyledger-core instead of tendermint #2
Comments
I figured I'd post my progress here and see if anyone can find something obvious while I continue to debug. I'm using the evan/replace-tendermint branch, where I have manually replaced tendermint with lazyledger-core, updated the tendermint related proto files, and made a few minor compatibility changes to allow things to compile with the latest master branch of the sdk and lazyledger-core. Any ideas on what to try would be greatly appreciated. There are still nine tests that won't pass, but I think some are caused by the same issue. Here are the tests and their error, along with the full output of
fixed the above two with fadd156c36eed33ef22c92a0aa80ce65e9bf8a36, which was stopping viper from unmarshalling a config file properly. However, after comparing ll-core, tendermint, and various versions of the sdk, I can't find a difference for why this tests fails when replacing tendermint with ll-core. Both have the same version of relevant dependencies and idendical config tags
The output also repeats this message a few times, which I think might be because the cosmos-sdk is using the cosmos/iavl, which, as discussed here, has dependencies for tendermint, and also caries an extra copy of all the proto files in lazyledger-core. I'm going to try changing the proto package declarations for lazyledger-core next.
|
Is there a branch I can checkout? |
So good (maybe bad...) news. After some more digging, all the remaining errors are due to the same thing. For some reason, protobuf is not recognizing the custom type found in two of the x/mint module's QueryResponse types Inflation and AnnualProvisions. The weird thing is that this custom type is used in many other protobuf message types, including the mint module's own Params message, which does not have same issue as the two mentioned message types, even when ran in the same test |
Can you post the actual error? I might want to look into this since I've had to wrestle with protobuf before. |
|
Just an update and personal notes on this sneaky bug: Tomorrow, I'll give another go at recreating the bug outside of this context, and then I think I'm going to try #138 porting changes from v0.34.2 to lazyledger-core, and see if that makes a difference. PS: after diving through the layers of reflection in protobuf, I am now firmly in the "go needs generics" boat. |
Yeah, it's probably a good idea if ll-core is on par with the release that version of the SDK uses (independent of if this is causing the described problems or not; but it's likely related). |
You've probably already figured this out but these also originate from tendermint/ll-core: Two different versions of this try to get registered (prob. due to the different tendermint versions that were used) func RegisterType(x Message, name string) {
if _, ok := protoTypedNils[name]; ok {
// TODO: Some day, make this a panic.
log.Printf("proto: duplicate proto type registered: %s", name)
return
}
// ... |
Huge thank you to @liamsi for finding the source of the bugs, and to everyone else that took the time to help me. It was a dependency issue, although I tried different versions of protobuf and gogo/protobuf, I wasn't changing versions of grpc, which was the problem dependency that got auto updated by switching to lazyledger-core. Since then, lazyledger-core's version of grpc has been downgraded, and a PR submitted to close this issue. I guess I also owe an apology to protobuf, for all the curses I threw its way while I tried to fix what I thought was a sneaky marshalling bug. We still might want to look into a fix for the duplicate registry of protobuf types, but that's another issue. |
Ensure that this fork uses lazyledger-core instead of tendermint as we will make use of some modifications of ll-core.
This probably means to search and replace go-imports. If a less invasive approach works that's even better (e.g. the replace directive).
The text was updated successfully, but these errors were encountered: