-
Notifications
You must be signed in to change notification settings - Fork 1k
[N4] Whitelist of Free Contracts #4201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
* 100% Coverage Trie.Get * fix ut Co-authored-by: Shargon <[email protected]>
* Makefile support for mainnet full node Dockerfile * add docker run * add container name * update doc * improve * some improvement --------- Co-authored-by: Shargon <[email protected]>
* optimize: command tokenizer * Fix: keep consistency with legacy behaviour when quote char not at first char --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: NGD Admin <[email protected]>
* Fix: make the signer sign specific data * Plugin: add SignClient * Remove x64 and x86 configurations from solution file * [`ut`] 100% Coverage Trie.Get (#3952) * 100% Coverage Trie.Get * fix ut --------- Co-authored-by: NGD Admin <[email protected]> Co-authored-by: Jimmy <[email protected]> Co-authored-by: Shargon <[email protected]>
* style: make the code style of StatuePlugin more standard * Update src/Plugins/StateService/StatePlugin.cs Co-authored-by: Shargon <[email protected]> * [`ut`] 100% Coverage Trie.Get (#3952) * 100% Coverage Trie.Get * fix ut --------- Co-authored-by: Vitor Nazário Coelho <[email protected]> Co-authored-by: Shargon <[email protected]> Co-authored-by: NGD Admin <[email protected]> Co-authored-by: Jimmy <[email protected]>
… zip files after unzip (#3958) Co-authored-by: Jimmy <[email protected]>
* fix ut Co-authored-by: Shargon <[email protected]>
- Add comprehensive Contributing section to README - Document branch rules: master (stable release) vs dev (development) - Specify that all PRs must be based on dev branch, not master - Include step-by-step PR creation guidelines - Add development workflow diagram - Update table of contents to include Contributing section - Provide clear instructions for fork, branch, commit, and PR process Co-authored-by: Shargon <[email protected]> Co-authored-by: NGD Admin <[email protected]>
…3962) * [UnitTest] - Add unit tests for BigDecimal to increase code coverage * Update tests/Neo.UnitTests/UT_BigDecimal.cs --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: NGD Admin <[email protected]>
* Adding unit test to increase coverage in UInt256 and UInt160. Modify some styles * Apply suggestions from code review Remove multiple blank lines * Update src/Neo/UInt160.cs Co-authored-by: Will <[email protected]> * Update src/Neo/UInt160.cs Co-authored-by: Will <[email protected]> * Fix: apply suggested changes to UInt160 and UInt256 * [UnitTest] - Add unit tests for BigDecimal to increase code coverage --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Will <[email protected]> Co-authored-by: NGD Admin <[email protected]> Co-authored-by: Jimmy <[email protected]>
* [`ut`] 100% Coverage Trie.Get (#3952) * 100% Coverage Trie.Get * fix ut * Update devcontainer.dockerfile version --------- Co-authored-by: Shargon <[email protected]> Co-authored-by: Jimmy <[email protected]>
…hod; 2. Add ShowDllNotFoundError to make exception handling clearer (#3955) Co-authored-by: Jimmy <[email protected]> Co-authored-by: NGD Admin <[email protected]> Co-authored-by: Shargon <[email protected]>
- Add comprehensive documentation for Neo persistence system class relationships - Document interface hierarchy (IStore, IStoreSnapshot, IReadOnlyStore, IWriteStore, IStoreProvider) - Explain class structure and relationships between providers, stores, snapshots, and caches - Detail cache system with DataCache, StoreCache, and ClonedCache relationships - Include data types (StorageKey, StorageItem) and enums (TrackState, SeekDirection) - Provide clear explanations of when to use each cache type - Add typical usage patterns for layered caching architecture Co-authored-by: Shargon <[email protected]>
…alize (#3966) * Optimize: Avoid stack alloc in UInt160 and UInt256 Serialize * Optimize: Avoid stack alloc in UInt160 and UInt256 Serialize --------- Co-authored-by: Shargon <[email protected]>
* Add log * Rename * OnNewSnapshot rename * Update src/Neo/Persistence/DataCache.cs --------- Co-authored-by: Will <[email protected]>
…#3972) * Optimize: keep more exception info when UInt160.Parse and UInt256.Parse throw exception * Update src/Neo.Extensions/StringExtensions.cs Co-authored-by: Christopher Schuchardt <[email protected]> * Optimize: keep more exception info when UInt160.Parse and UInt256.Parse throw exception * Update src/Neo/UInt160.cs --------- Co-authored-by: Christopher Schuchardt <[email protected]> Co-authored-by: Shargon <[email protected]>
Add a couple of compatibility edge-cases, ref. nspcc-dev/neo-go#3926. Signed-off-by: Anna Shaleva <[email protected]>
Co-authored-by: Shargon <[email protected]>
Co-authored-by: Jimmy <[email protected]>
Co-authored-by: Will <[email protected]>
* Add: more exception info when throw exception * Update src/Neo/SmartContract/Native/PolicyContract.cs Co-authored-by: Shargon <[email protected]> * Update src/Neo/SmartContract/Native/PolicyContract.cs Co-authored-by: Shargon <[email protected]> * Update src/Neo/SmartContract/Native/PolicyContract.cs Co-authored-by: Shargon <[email protected]> * Add: more exception info when throw exception --------- Co-authored-by: Shargon <[email protected]>
* Style and decorators * format --------- Co-authored-by: Will <[email protected]>
Co-authored-by: Jimmy <[email protected]>
| "contract", ContractParameterType.Hash160, | ||
| "method", ContractParameterType.String, | ||
| "argCount", ContractParameterType.Integer, | ||
| "fee", ContractParameterType.Any |
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.
fee is ContractParameterType.Any?
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.
it can be null in RemoveWhitelistFeeContract
* Fix: null reference exception on start * Fix peer startup race before ChannelsConfig * Update src/Neo/Network/P2P/Peer.cs Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Wi1l-B0t <[email protected]> Co-authored-by: Shargon <[email protected]> Co-authored-by: Alvaro <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Vitor Nazário Coelho <[email protected]>
The base branch was changed.
|
Changed to master |
|
Later we port from Master to Master-n3 |
|
@shargon, I resolved conflicts, they were minor. |
|
I noticed that most of the conflicts should had been resolved automatically, they were just some change from this branch and empty lines or break lines from the other side. |
| private const int Int32Length = PrefixLength + sizeof(int); | ||
| private const int Int64Length = PrefixLength + sizeof(long); | ||
| private const int UInt160Length = PrefixLength + UInt160.Length; | ||
| internal const int UInt160Length = PrefixLength + UInt160.Length; |
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.
Why internal?
| public const uint MaxMaxTraceableBlocks = 2102400; | ||
|
|
||
| private const byte Prefix_BlockedAccount = 15; | ||
| internal const byte Prefix_WhitelistedFeeContracts = 16; |
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.
Why internal?
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.
Because it's used by UT
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.
I think it should be private. You can recalculate this value in UT.
| if (engine.IsHardforkEnabled(Hardfork.HF_Faun) && Policy.IsWhitelistFeeContract(engine.SnapshotCache, Hash, method.Name, method.Parameters.Length, out var fixedFee)) | ||
| { | ||
| // Whitelisted In the unit of datoshi, 1 datoshi = 1e-8 GAS | ||
| engine.AddFee(fixedFee.Value); |
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.
I think this implementation might be wrong. NativeContract.Invoke cannot be called directly. It can only be called by Contract.Call. So there might be a double charge here.
Selected contracts can be executed without fees, promoting adoption of stablecoins for payments and settlements.
This feature is included in the neo4 roadmap, has been discussed during CentrePoint, and is considered to be included in the next version without having to wait for neo4.
This pull request only includes the definition of the whitelist by the commit, after being accepted I will proceed to the actual consumption of this whitelist by the
ApplicationEngineType of change
How Has This Been Tested?
Test Configuration:
Checklist: