Open leohhhn opened 5 months ago
Possibly related: https://github.com/gnolang/gno/issues/1543
Since it can not be replicated, I wonder that did it happened with all the key of Blog tree or just randomly failed?
@thinhnx-var
It happens on every call to the function.
EDIT: It is a bit hard to replicate this - you can run gnodev
, and use your address as the admin address in the gnoland/blog/admin.gno
file. Then, you can use the gnoblog-cli
from the blog repo to post a specific post to the local gnodev
node, and then you can try calling the ModRemovePost()
function in the gnoland/blog
realm to see the issue.
Hopefully we will have better previews and ways to replicate these kind of things.
@leohhhn so the flow to reproduce is just add a post and then call ModRemovePost
? I tried this and wasn't able to reproduce the issue. I did this running gnodev after replacing the admin address with the test1
address:
gnoblog-cli post posts/2022-05-02_peace/README.md -publish -key test1
gnokey maketx call -pkgpath "gno.land/r/gnoland/blog" -func "ModRemovePost" -gas-fee 1000000ugnot -gas-wanted 2000000 -send "" -broadcast -chainid "dev" -args "peace" -remote "tcp://127.0.0.1:26657" test1
@deelawn I tried it as well, and seems that gnodev
has the transaction passing, but if you try to open up the blog on gnoweb
, it errors with unexpected object with id b267d23c27c167591da35b2b4bd51435eddcd5eb:8
. The Portal Loop however, still keeps breaking:
❯ gnokey maketx call -pkgpath "gno.land/r/gnoland/blog" -func "ModRemovePost" -gas-fee 1000000ugnot -gas-wanted 2000000 -send "" -broadcast -chainid "portal-loop" -args "the-gnome" -remote "https://rpc.gno.land:443" main
Enter password.
--= Error =--
Data: deleted descendants should not have a reference count of less than zero
Msg Traces:
0 /Users/sasurai/Desktop/gno/gno/tm2/pkg/crypto/keys/client/maketx.go:213 - deliver transaction failed: log:msg:0,success:false,log:--= Error =--
Data: &errors.errorString{s:"deleted descendants should not have a reference count of less than zero"}
Msg Traces:
0 /home/runner/work/gno/gno/gno.land/pkg/sdk/vm/keeper.go:318 - VM call panic: deleted descendants should not have a reference count of less than zero
Very weird.
We'll assign this to @omarsy - have to add him to the team
Description
This is a bit of a weird issue @ajnavarro and I came across while fixing the blog package. Namely, we implemented this function, which removes a pointer to a post from three trees. It makes sure to get the correct keys before removing anything from the trees, to avoid any possible bugs. However, when calling this function, you get the following errror:
I tried isolating & replicating the issue with a simple txtar, but I didn't get lucky, as this test is passing. Any ideas?