Fix/Actualize notary requests parsing #268

Merged
fyrchik merged 1 commit from fix/notary-preparator-is-outdated into master 2023-04-20 07:37:14 +00:00
2 changed files with 7 additions and 4 deletions

View file

@ -9,6 +9,7 @@ Changelog for FrostFS Node
- Take network settings into account during netmap contract update (#100)
- Read config files from dir even if config file not provided via `--config` for node (#238)
- Expired by more than 1 epoch objects could be returned (#262)
- Notary requests parsing according to `neo-go`'s updates (#268)
### Removed
### Updated

View file

@ -185,13 +185,15 @@ func (p Preparator) validateNotaryRequest(nr *payload.P2PNotaryRequest) error {
}
invokerWitness := ln == 4
multiInvScript := nr.MainTransaction.Scripts[1].InvocationScript
// alphabet node should handle only notary requests
// that have been sent unsigned(by storage nodes) =>
// such main TXs should have dummy scripts as an
// invocation script
// that have been sent unsigned (by storage nodes) =>
// such main TXs should have either a dummy or an
// empty script as an invocation script
//
// this check prevents notary flow recursion
if !bytes.Equal(nr.MainTransaction.Scripts[1].InvocationScript, p.dummyInvocationScript) {
if len(multiInvScript) > 0 && !bytes.Equal(nr.MainTransaction.Scripts[1].InvocationScript, p.dummyInvocationScript) {
return ErrTXAlreadyHandled
}