Comments (6)
Thanks for reporting.
Is there already an unambiguous description of the feature? It has been discussed last week but there were different interpretations of its working based on the news.
from neo-python.
@saltyskip @ixje I can confirm this behavior. When we implemented the SimplePolicyPlugin
in #869, we only implemented for relaying transactions, not if a rawtransaction was sent to the node and then verified. I have since implemented similar logic in the Verify
function and tested.
from neo-python.
The SimplePolicy implementation in #964 works, but the transaction fee is still calculated incorrectly. I believe this is because the transaction is built is using the network fee as calculated from test_invoke
that is based on the unsigned transaction size, but the signed transaction size is larger, leading to a failure during Transaction.Verify
.
I added an extra debugging line locally to test_invoke
to print the wallet_tx.Size()
it was basing the fee off of, and then tried to deploy a contract:
Calculating required fee for transaction with size: 11299
-------------------------------------------------------------------------------------------------------------------------------------
Test deploy invoke successful
Total operations executed: 11
Results:
[<neo.Core.State.ContractState.ContractState object at 0x1147a12b0>]
Deploy Invoke TX GAS cost: 490.0
Deploy Invoke TX Fee: 0.10275
-------------------------------------------------------------------------------------------------------------------------------------
Enter your password to deploy this contract on the blockchain
[password]> **********************
[D 190717 09:06:09 Transaction:596] Verifying transaction: b'abf44004b7176d16f62ec404c29384f71011499a38d8fe6609005e1e5d14d194' (size: 11427 bytes)
[D 190717 09:06:09 Transaction:608] The tx size (11427) exceeds the max free tx size (1024).
A network fee of 0.10403 GAS is required.
[E 190717 09:06:09 mempool:28] Verifying tx result... failed
Could not relay tx abf44004b7176d16f62ec404c29384f71011499a38d8fe6609005e1e5d14d194
You can see test_invoke
calculated the transaction size as 11299 but after signing, Verify
calculated it as 11427
, so the attached fee was insufficient to continue.
from neo-python.
@hal0x2328 thank you for looking into this. So as I understand it, #964 is still valid but I need to move the logic for the SimplePolicy in #869 to after the tx is signed. This makes a lot of sense.
from neo-python.
@jseagrave21 do you want to look into this? Perhaps this can help
https://github.com/neo-project/neo-plugins/blob/master/SimplePolicy.UnitTests/UT_SimplePolicy.cs
from neo-python.
@ixje yes, I will look into it. I will proceed as mentioned above. It shouldn't take me too long.
from neo-python.
Related Issues (20)
- Circular map reference causes Python stack overflow
- Docker build exits with errors HOT 9
- Parser breaks when reading --tx-attr argument with spaces HOT 3
- Privatenet fails to initialize HOT 2
- neo-python can't sync with Neo 2.10.3 nodes HOT 1
- Deploy Neo Smart Contract at runtiime. HOT 5
- Wallet & np-api-server issues HOT 2
- BigInteger ToByteArray incompatible with neo-vm v3.0.0 HOT 1
- Unclaimed gas calculation incorrect HOT 6
- About NEP-5 Smart Contracts HOT 8
- docker 只有Ubuntu的吗,在centos上运行出错
- centos7下,运行np-prompt,卡顿后后,ctrl + z 退出后,再此运行np-prompt,报错 HOT 1
- 运行np-prompt后,prompt.log中报错, HOT 1
- 运行np-prompt后,没有出现NEO命令行
- Connect to node problem HOT 2
- TestNet bootstrap HOT 1
- prompt input parser parses nested lists incorrectly HOT 1
- np-bootstrap -c configure my local sync node that haved sync and the block data is finish. HOT 1
- np-bootstrap hangs at confirm prompt 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-python.