From 3bf8192f9816bcd03dfc29f3817778366d358507 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 19 Apr 2023 17:18:04 +0300 Subject: [PATCH] rpcclient: make Notary Actor follow the request creation doc All Notary contract witnesses in incomplete transaction (both main and fallback) may either have invocation scripts pushing dummy signature on stack or be empty, both ways are OK. Notary actor keeps main tx's Notary witness empty and keeps fallback tx's Notary witness filled with dummy signature. Signed-off-by: Anna Shaleva --- docs/notary.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/notary.md b/docs/notary.md index c11e23f9b..8fe10b3d2 100644 --- a/docs/notary.md +++ b/docs/notary.md @@ -356,9 +356,9 @@ subpackage with an example written in Go doc. with `Deployed` set to `false` and `Script` set to the signer's verification script. - An account for a notary signer is **just a placeholder** and should have - `Contract` field with `Deployed` set to `false`, i.e. the default value for - `Contract` field. That's needed to skip notary verification during regular - network fee calculation at the next step. + `Contract` field with `Deployed` set to `true`. Its `Invocation` witness script + parameters will be guessed by the `verify` method signature of Notary contract + during the network fee calculation at the next step. 6. Fill in the main transaction `Nonce` field. 7. Construct a list of main transactions witnesses (that will be `Scripts` @@ -367,11 +367,17 @@ subpackage with an example written in Go doc. - A contract-based witness should have `Invocation` script that pushes arguments on stack (it may be empty) and empty `Verification` script. If multiple notary requests provide different `Invocation` scripts, the first one will be used - to construct contract-based witness. + to construct contract-based witness. If non-empty `Invocation` script is + specified then it will be taken into account during network fee calculation. + In case of an empty `Invocation` script, its parameters will be guessed from + the contract's `verify` signature during network fee calculation. - A **Notary contract witness** (which is also a contract-based witness) should - have empty `Verification` script. `Invocation` script should be of the form - [opcode.PUSHDATA1, 64, make([]byte, 64)...], i.e. to be a placeholder for - a notary contract signature. + have empty `Verification` script. `Invocation` script should be either empty + (allowed for main transaction and forbidden for fallback transaction) or of + the form [opcode.PUSHDATA1, 64, make([]byte, 64)...] (allowed for main + transaction and required for fallback transaction by the Notary subsystem to + pass verification), i.e. to be a placeholder for a notary contract signature. + Both ways are OK for network fee calculation. - A standard signature witness must have regular `Verification` script filled even if the `Invocation` script is to be collected from other notary requests.