Skip to content

Conversation

@shargon
Copy link
Member

@shargon shargon commented Oct 1, 2025

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 ApplicationEngine

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Working on it after define the methods and structure

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

NGDAdmin and others added 30 commits May 22, 2025 08:05
* 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]>
* 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]>
* 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]>
"contract", ContractParameterType.Hash160,
"method", ContractParameterType.String,
"argCount", ContractParameterType.Integer,
"fee", ContractParameterType.Any
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fee is ContractParameterType.Any?

Copy link
Member Author

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

AnnaShaleva
AnnaShaleva previously approved these changes Oct 29, 2025
Jim8y and others added 4 commits November 1, 2025 23:17
* 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]>
Wi1l-B0t
Wi1l-B0t previously approved these changes Nov 2, 2025
ajara87
ajara87 previously approved these changes Nov 2, 2025
@vncoelho vncoelho changed the base branch from dev to master November 2, 2025 16:42
@vncoelho vncoelho dismissed stale reviews from ajara87, Wi1l-B0t, and AnnaShaleva November 2, 2025 16:42

The base branch was changed.

@vncoelho
Copy link
Member

vncoelho commented Nov 2, 2025

Changed to master

@vncoelho vncoelho changed the base branch from master to master-n3 November 2, 2025 16:43
@vncoelho vncoelho changed the base branch from master-n3 to master November 2, 2025 16:47
@vncoelho
Copy link
Member

vncoelho commented Nov 2, 2025

Later we port from Master to Master-n3

@vncoelho
Copy link
Member

vncoelho commented Nov 2, 2025

@shargon, I resolved conflicts, they were minor.

@vncoelho
Copy link
Member

vncoelho commented Nov 2, 2025

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;
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why internal?

Copy link
Member Author

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

Copy link
Member

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);
Copy link
Member

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.

This was referenced Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical Issues (bugs) that need to be fixed ASAP neo4 Waiting for Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.