Panic: Unknown transaction #6

Closed
opened 2024-07-09 13:00:28 +00:00 by achuprov · 5 comments
Member

Current Behavior

./bin/monza explore -r http://morph-chain.frostfs.devenv:30333

./bin/monza explore -r http://morph-chain.frostfs.devenv:30333 
panic: Unknown transaction (-103) [recovered]
        panic: Unknown transaction (-103)

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
        /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/application.go:243 +0x45
panic({0x8cf0a0?, 0xc000651290?})
        /usr/lib/go-1.22/src/runtime/panic.go:770 +0x132
main.(*Explorer).cacheNotifications(0xc000092ae0, 0xc000000007?)
        /home/achuprov/Documents/work/monza/explorer.go:428 +0x345
main.(*Explorer).Run.func8(0xc000011290?, {0x0?, 0x0?}, {0xc000011290?, 0xc00045f780?}, 0x411d65?)
        /home/achuprov/Documents/work/monza/explorer.go:222 +0x7c
github.com/rivo/tview.(*List).InputHandler.func1(0xc00022b008?, 0xc0001861c0?)
        /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/list.go:622 +0x10b
github.com/rivo/tview.(*List).InputHandler.(*Box).WrapInputHandler.func2(0xc0001dca90?, 0xc0002001d0?)
        /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/box.go:167 +0x50
github.com/rivo/tview.(*Grid).InputHandler.func1(0xc0000907e0, 0xc0002001d0)
        /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/grid.go:274 +0x1b7
github.com/rivo/tview.(*Grid).InputHandler.(*Box).WrapInputHandler.func2(0xc00017cea0?, 0xc0002001d0?)
        /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/box.go:167 +0x50
github.com/rivo/tview.(*Application).Run(0xc0001860e0)
        /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/application.go:335 +0x738
main.(*Explorer).Run(0xc000092ae0)
        /home/achuprov/Documents/work/monza/explorer.go:269 +0x17ea
main.explorer(0xc00021c2c0)
        /home/achuprov/Documents/work/monza/explorer.go:79 +0x3f4
github.com/urfave/cli/v2.(*Command).Run(0xc000112b40, 0xc00021c0c0)
        /home/achuprov/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x583
github.com/urfave/cli/v2.(*App).RunContext(0xc0000f1040, {0xacefd8, 0xe73320}, {0xc0000220c0, 0x4, 0x4})
        /home/achuprov/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0xae5
github.com/urfave/cli/v2.(*App).Run(...)
        /home/achuprov/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
main.main()
        /home/achuprov/Documents/work/monza/main.go:69 +0x53c

Steps to Reproduce (for bugs)

  1. devenv: make clean up
  2. find and select the first block where there are 6 or 7 transactions
<!-- Provide a general summary of the issue in the Title above --> ## Current Behavior ` ./bin/monza explore -r http://morph-chain.frostfs.devenv:30333 ` ``` ./bin/monza explore -r http://morph-chain.frostfs.devenv:30333 panic: Unknown transaction (-103) [recovered] panic: Unknown transaction (-103) goroutine 1 [running]: github.com/rivo/tview.(*Application).Run.func1() /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/application.go:243 +0x45 panic({0x8cf0a0?, 0xc000651290?}) /usr/lib/go-1.22/src/runtime/panic.go:770 +0x132 main.(*Explorer).cacheNotifications(0xc000092ae0, 0xc000000007?) /home/achuprov/Documents/work/monza/explorer.go:428 +0x345 main.(*Explorer).Run.func8(0xc000011290?, {0x0?, 0x0?}, {0xc000011290?, 0xc00045f780?}, 0x411d65?) /home/achuprov/Documents/work/monza/explorer.go:222 +0x7c github.com/rivo/tview.(*List).InputHandler.func1(0xc00022b008?, 0xc0001861c0?) /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/list.go:622 +0x10b github.com/rivo/tview.(*List).InputHandler.(*Box).WrapInputHandler.func2(0xc0001dca90?, 0xc0002001d0?) /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/box.go:167 +0x50 github.com/rivo/tview.(*Grid).InputHandler.func1(0xc0000907e0, 0xc0002001d0) /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/grid.go:274 +0x1b7 github.com/rivo/tview.(*Grid).InputHandler.(*Box).WrapInputHandler.func2(0xc00017cea0?, 0xc0002001d0?) /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/box.go:167 +0x50 github.com/rivo/tview.(*Application).Run(0xc0001860e0) /home/achuprov/go/pkg/mod/github.com/rivo/tview@v0.0.0-20220307222120-9994674d60a8/application.go:335 +0x738 main.(*Explorer).Run(0xc000092ae0) /home/achuprov/Documents/work/monza/explorer.go:269 +0x17ea main.explorer(0xc00021c2c0) /home/achuprov/Documents/work/monza/explorer.go:79 +0x3f4 github.com/urfave/cli/v2.(*Command).Run(0xc000112b40, 0xc00021c0c0) /home/achuprov/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x583 github.com/urfave/cli/v2.(*App).RunContext(0xc0000f1040, {0xacefd8, 0xe73320}, {0xc0000220c0, 0x4, 0x4}) /home/achuprov/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0xae5 github.com/urfave/cli/v2.(*App).Run(...) /home/achuprov/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 main.main() /home/achuprov/Documents/work/monza/main.go:69 +0x53c ``` ## Steps to Reproduce (for bugs) <!-- Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. --> 1. devenv: `make clean up` 2. find and select the first block where there are 6 or 7 transactions
alexvanin added the
bug
label 2024-07-22 13:08:25 +00:00
nzinkevich was assigned by alexvanin 2024-07-29 06:30:00 +00:00
Member

The problem arises due to chain cache. It's stored in ~/.config/monza by default. If you do some manipulations with one devenv and then make clean restart, monza does not clean up cache file - just opens it "as it is" without distinguishing old data from new. Thus if the block with the specified index already exists, it will take old block from cache instead of making request to get new. That's why some transactions are invalid and explore panics.
For now just remove old cache file by yourself.

The problem arises due to chain cache. It's stored in ~/.config/monza by default. If you do some manipulations with one devenv and then make clean restart, `monza` does not clean up cache file - just opens it "as it is" without distinguishing old data from new. Thus if the block with the specified index already exists, it will take old block from cache instead of making request to get new. That's why some transactions are invalid and `explore` panics. For now just remove old cache file by yourself.
Owner

Can we have some chain-dependent cache?
One reasonable thing to do it to use network magic as the name, but network magic repeats in tests.
We can use the hash of the first block, though -- it contains timestamp, so should be unique.
And if we have no first block, we have nothing to cache anyway.

Can we have some chain-dependent cache? One reasonable thing to do it to use network magic as the name, but network magic repeats in tests. We can use the hash of the first block, though -- it contains timestamp, so should be unique. And if we have no first block, we have nothing to cache anyway.
Member

Can we have some chain-dependent cache?
One reasonable thing to do it to use network magic as the name, but network magic repeats in tests.
We can use the hash of the first block, though -- it contains timestamp, so should be unique.
And if we have no first block, we have nothing to cache anyway.

Added validation via the first block

> Can we have some chain-dependent cache? > One reasonable thing to do it to use network magic as the name, but network magic repeats in tests. > We can use the hash of the first block, though -- it contains timestamp, so should be unique. > And if we have no first block, we have nothing to cache anyway. Added validation via the first block
Owner

We can use the hash of the first block, though -- it contains timestamp, so should be unique.

That's brilliant, I like it.

> We can use the hash of the first block, though -- it contains timestamp, so should be unique. That's brilliant, I like it.
Owner

Fixed in #7

Fixed in #7
Sign in to join this conversation.
No description provided.