Comments (5)
I need to use the actual signers; otherwise, the check witness calls will fail. If it fails, the system fee will be incorrect.
These are different fees and nothing prevents you from using one set of signers for system fee calculation and the other for network fee calculation.
from neo-go.
Your transaction is:
{
"Version": 0,
"Nonce": 2514125905,
"SystemFee": 0,
"NetworkFee": 0,
"ValidUntilBlock": 107,
"Script": "DAR0ZXN0AGQMFA2pZ6QAQyvyf46OtG/orGWezN4EDBRt/ZapzGBDT9YILYp1q1ufMj9X9BTAHwwIdHJhbnNmZXIMFM924ovQBixKR47jVWEBExnzz6TSQWJ9W1I=",
"Attributes": [],
"Signers": [
{
"account": "0x04decc9e65ace86fb48e8e7ff22b4300a467a90d",
"scopes": "CalledByEntry"
},
{
"account": "0xf4573f329f5bab758a2d08d64f4360cca996fd6d",
"scopes": "CalledByEntry"
}
],
"Scripts": [
{
"invocation": "DEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"verification": "DCEDWpKPIBY5IE4GtDaLGpM2VGKo67/wuIGBUbdPqrOithpBVuezJw=="
},
{
"invocation": "DEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"verification": "DCEDWpKPIBY5IE4GtDaLGpM2VGKo67/wuIGBUbdPqrOithpBVuezJw=="
}
],
"Trimmed": false
}
So you have two signers here. Then you pass two witnesses with this verification code:
INDEX OPCODE PARAMETER
0 PUSHDATA1 035a928f201639204e06b4368b1a93365462a8ebbff0b8818151b74faab3a2b61a <<
35 SYSCALL System.Crypto.CheckSig (56e7b327)
Which hashes down to 0x04decc9e65ace86fb48e8e7ff22b4300a467a90d. This is the hash of the first signer, but the second one is different, that's why you get an error:
{"id":1,"jsonrpc":"2.0","error":{"code":-508,"message":"Invalid signature","data":"witness hash mismatch"}}
And it's a valid one, if you're to take the network fee data, stuff it into your transaction, sign and try to send it --- it'd be invalid. To make it a valid one you need a proper script for the second signer, if you're to provide that NeoGo will happily calculate the network fee. Right now it can't, it doesn't have a script for 0xf4573f329f5bab758a2d08d64f4360cca996fd6d signer (which btw, can be anything, not just a simple signature, but we don't know).
NOBUG.
from neo-go.
Hi @roman-khimov,
We don't have access to the verification script, so we are using a placeholder. To produce a valid verification script, we would need the public key. It looks like C# parses it as a 'placeholder'. I understand that this is not ideal: it always calculates the fees using a 'single-sig account,' whereas, in practice, it could be a multi-sig.
The main issue is that the application works with C# nodes but not with Neo Go nodes. This inconsistency causes it to work for some users and not for others. If the signer is not present, could it be considered a default single-signature account? (mimic c#)
from neo-go.
We don't have access to the verification script, so we are using a placeholder
But you have to get a proper verification script and put it into transaction. You just have to do this before calculatenetworkfee
and not after that. Otherwise you can stub the signer account as well (use a random key and account), it'll work fine for fee calculation.
The main issue is that the application works with C# nodes but not with Neo Go nodes.
neo-project/neo#2805 will be implemented eventually and I expect C# nodes to get this behavior as well.
from neo-go.
Hello,
Thank you for the super fast response.
I need to use the actual signers; otherwise, the check witness calls will fail. If it fails, the system fee will be incorrect.
EDIT: I get it now. We can use the stub to calculate the network fee. It won't affect the system fee because it's calculated using a test invoke
from neo-go.
Related Issues (20)
- Ensure `System.Runtime.GetNotifications` handler operates with a deep copy of notifications HOT 3
- Fees of unlucky mempool tx are not properly cleared from the pool
- Investigate System.Runtime.Notify refcounting
- Check NeoFS chains compatibility with limited MaxTraceableBlocks HOT 8
- Implement experimental Depends attribute
- Implement experimental fetching of blocks from NeoFS container
- TLS handshake error
- inconsistent cli help information for db dump HOT 1
- improve feedback when using wrong file to restore db from HOT 2
- WS Client support for CLI
- Extend netmode package with NeoFSMainNet and NeoFSTestNet HOT 2
- Neo-go (master branch) not starting ("Hardforks configuration section contains unexpected hardfork: Domovoi") HOT 5
- CLI usage text unification HOT 2
- Default session expiration may be unexpected to a regular user HOT 5
- default timeouts are extremely aggressive
- Support modifying unsigned transaction by `actor.Actor` HOT 10
- aggressive memory usage HOT 1
- Panic in WS client in subscription mechanism HOT 1
- CLI mistake in aliases for compare-states
- Check state dump time for mainnet HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neo-go.