network: unplug stateroot service from the Server

Notice that it makes the node accept Extensible payloads with any category
which is the same way C# node works. We're trusting Extensible senders,
improper payloads are harmless until they DoS the network, but we have some
protections against that too (and spamming with proper category doesn't differ
a lot).
This commit is contained in:
Roman Khimov 2022-01-12 21:09:37 +03:00
parent 0ad3ea5944
commit 66aafd868b
6 changed files with 46 additions and 55 deletions

View file

@ -351,7 +351,7 @@ func TestService_OnPayload(t *testing.T) {
p.encodeData()
// sender is invalid
srv.OnPayload(&p.Extensible)
require.NoError(t, srv.OnPayload(&p.Extensible))
shouldNotReceive(t, srv.messages)
p = new(Payload)
@ -359,7 +359,7 @@ func TestService_OnPayload(t *testing.T) {
p.Sender = priv.GetScriptHash()
p.SetPayload(&prepareRequest{})
require.NoError(t, p.Sign(priv))
srv.OnPayload(&p.Extensible)
require.NoError(t, srv.OnPayload(&p.Extensible))
shouldReceive(t, srv.messages)
}