-
Notifications
You must be signed in to change notification settings - Fork 189
Implement SimplePolicyPlugin in Transaction.Verify #964
Conversation
Merge CoZ Development into jseagrave21 Development
Merge CoZ Development into jseagrave21 Development
Merge CoZ Development into jseagrave21 Development
* Update ExtendedJsonRpcApi.py - add fix provided by @localhuman so original methods are returned as well as extended methods
…yOfZion#661) * Add the option -u (unittest-net) to prompt.py * Add unittest guildeline and add the smart contract source codes (UnitTest-SM.zip) to the fixtures package
for compatibility
* Fix ExtendedJsonRpcApi (CityOfZion#662) * Update ExtendedJsonRpcApi.py - add fix provided by @localhuman so original methods are returned as well as extended methods * Mute expected test stacktrace and clearly identify why an exception is thrown. (CityOfZion#663) * Add guideline for adding tests to the neo-privnet-unittest image (CityOfZion#661) * Add the option -u (unittest-net) to prompt.py * Add unittest guildeline and add the smart contract source codes (UnitTest-SM.zip) to the fixtures package * Add raw transaction building examples (CityOfZion#665) * Update neo-boa version to fix core building test
Merge CoZ Development into jseagrave21 Development
Merge CoZ Development into jseagrave21 Development
Merge CoZ Development into jseagrave21 Development
Merge CoZ Development into jseagrave21 development
Merge CoZ development into jseagrave21 development
- add tests for "showallaccounts" and "showallaccountstates"
Merge neo-python development into jseagrave21 development
Merge neo-python development into jseagrave21 development
Merge neo-python development into jseagrave21 development
Merge CoZ development into jseagrave21 development
Gracefully handle NEP-5 balance query failures (CityOfZion#744)
Merge CoZ development into neo-python development
Merge CoZ development into jseagrave21 development
Merge CoZ Development into jseagrave21 development
Merge CoZ/neo-python development into jseagrave21/neo-python development
…into development
…into development
…into development
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution does not seem to take the following rule into account (ref):
Deploy and invoke smart contract with neo-cli v2.10.2 will cost 0.001 GAS as the starting fee.
This was clarified in #dev-general on Discord by @vncoelho that this was only introduced in neo-cli and not a limitation on Seed Nodes or Concensus Nodes. It was discussed further and removed here: neo-project/neo-node#378 |
I missed that. Thanks for the link! |
The implementation looks precise and the formula correct. |
thanks for the extra check @vncoelho |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe that if should be merged in the neocli as well.
fee = self.NetworkFee() | ||
if self.Size() > settings.MAX_FREE_TX_SIZE and not self.Type == b'\x02': # Claim Transactions are High Priority | ||
req_fee = Fixed8.FromDecimal(settings.FEE_PER_EXTRA_BYTE * (self.Size() - settings.MAX_FREE_TX_SIZE)) | ||
if req_fee < settings.LOW_PRIORITY_THRESHOLD: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the trick point. Nice job!
100 points |
What current issue(s) does this address, or what feature is it adding?
SimplePolicyPlugin
when verifying a tx in the mempoolHow did you solve this problem?
referenced logic used in #869 and logic I am using here https://github.com/jseagrave21/neo-python/blob/f75cb5dc58bedbfc12ea1a6afbca5332088f8ca6/neo/Core/TX/RawTransaction.py#L525-L541
How did you make sure your solution works?
make test
and verification manually on my testnet nodeAre there any special changes in the code that we should be aware of?
no
Please check the following, if applicable:
make lint
?make test
?CHANGELOG.rst
? (if not, please do)