[#268] notary_preparator: Actualize notary requests parsing
After 75d7891ca1
`neo-go` does claim that an empty invocation script is the only way to
fill missing signature for unsigned notary requests. The new notary actor
does it that way and, therefore, breaks notary request parsing by the
Alphabet because of skipping any request that is not filled with a dummy (64
zeros) invocation script. Support both way. The "Dummy" approach will be
dropped later.
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
This commit is contained in:
parent
6c90bb87f1
commit
4f5f832137
2 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue