This repository was archived by the owner on Nov 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
This repository was archived by the owner on Nov 10, 2025. It is now read-only.
applicationlogs get lost on shutdown #786
Copy link
Copy link
Closed
neo-project/neo
#2842Description
Describe the bug
Shutting down a node causes application logs to get lost.
To Reproduce
- install neo-cli and ApplicationLogs plugin
- run the node and let it sync a few blocks
- shutdown by typing
exitorctrl+c - edit
config.jsonand comment out the nodes and put some bogus IP in there to stop it from syncing any further (hi Remove unnecessary default seedlist neo#2773) - request the block applicationlog (not TX) of the last height (see
show state) using thegetapplicationlogRPC call - Observe that it cannot be found while the block itself found. The same holds for a couple of blocks near the end (height-
n)
for example using the snippet below on my local node I get
Testing http://127.0.0.1:20332
Validating applogs for block 0 to 2340
2336 - Unknown transaction/blockhash (-100) - at Neo.Plugins.LogReader.GetApplicationLog(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
2337 - Unknown transaction/blockhash (-100) - at Neo.Plugins.LogReader.GetApplicationLog(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
2338 - Unknown transaction/blockhash (-100) - at Neo.Plugins.LogReader.GetApplicationLog(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
2339 - Unknown transaction/blockhash (-100) - at Neo.Plugins.LogReader.GetApplicationLog(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
2340 - Unknown transaction/blockhash (-100) - at Neo.Plugins.LogReader.GetApplicationLog(JArray _params)
at Neo.Plugins.RpcServer.ProcessRequestAsync(HttpContext context, JObject request)
Expected behavior
I expect for each block that is persisted that the application log is also persisted when shut down.
Platform:
- OS: ubuntu 22.04
- Version: neo-cli 3.5.0
(Optional) Additional context
here's a small go snippet you can use to test
package main
import (
"context"
"fmt"
"github.com/nspcc-dev/neo-go/pkg/rpcclient"
"os"
)
func main() {
source := os.Args[1]
fmt.Println("Testing", source)
client, err := rpcclient.New(context.TODO(), source, rpcclient.Options{})
if err != nil {
panic(err)
}
err = client.Init()
if err != nil {
panic(err)
}
count, err := client.GetBlockCount()
if err != nil {
panic(err)
}
fmt.Printf("Validating applogs for block 0 to %d\n", count-1)
for i := uint32(0); i < count; i++ {
h, err := client.GetBlockHash(i)
if err != nil {
panic(err)
}
_, err = client.GetApplicationLog(h, nil)
if err != nil {
fmt.Println(fmt.Errorf("%d - %s", i, err.Error()))
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels