-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix reverse nil check #10286
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 reverse nil check #10286
Conversation
|
what bug are we talking about? |
|
oh wait when the fuck did this get here |
|
see the crash in the original issue |
|
Let's wait for Alex to check this. @somnathb1 fixed a DB inflation bug here. while @AskAlexSharov introduced it so they have better understanding of why that was there |
|
actually, now I see in the code that not sure if that was the original intention of the code because of the weird closure capture behaviors in golang, so may you take a deeper look at it @Giulio2002 pls? |
yeah, it is confusing, better have more eyes on it because I'm not an expert in this flow. |
|
Regardless, this fix makes sense. so it should be still approved. I think it was an oversight. I am looking at the code right now and I am 99.9999% confident it is a genuine fix. However, I want to see what others think too. I can make mistakes :) |
|
The code overall around this is quite confusing and needs quite the focus to understand. @wmitsuda can you please check |
Output:
So - we need split updateForkChoice func to 2 - then we will not need worry about closures/rollbacks_if_nil/etc... |
fixes #10285
however, looking at the code, a few lines above, I'm wondering why
txactually is nil here, cantx, err = e.db.BeginRwNosync(ctx)returntx == nilwhen there is no error?not clear to me what value
txis capturing inside the closure, I'm afraid this fix may hide another bug, I'm a little confused.