neo icon indicating copy to clipboard operation
neo copied to clipboard

[Neo Core Fix] Check params at Calling Contract

Open Jim8y opened this issue 1 year ago • 4 comments

Description

Neo core does not check the type of vales being passed to the contract, and this can cause problems.

for example: https://github.com/neo-project/neo-devpack-dotnet/issues/863

Fixes # https://github.com/neo-project/neo/issues/1891 https://github.com/neo-project/neo-devpack-dotnet/issues/863

Type of change

  • [ ] Optimization (the change is only an optimization)
  • [ ] Style (the change is only a code style for better maintenance or standard purpose)
  • [x] 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?

  • [x] Runtime_GetNotifications_Test
  • [x] Check_BalanceOfTransferAndBurn

Test Configuration:

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] 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

Jim8y avatar Jul 25 '24 18:07 Jim8y

Wait, wait, wait a minute! As much as I love this change you can't just roll it out with the nearest hardfork. Remember all the pain of https://github.com/neo-project/neo/pull/2810. We need to:

  • pre-announce it
  • make adjustments to compilers if needed
  • add some checks/logs to the node for developers to be aware
  • wait for them to update their contracts and have ~0 warnings in logs for current blocks
  • schedule the update

roman-khimov avatar Jul 25 '24 20:07 roman-khimov

Will this affect calls between contracts?

lock9 avatar Jul 26 '24 02:07 lock9

Wait, wait, wait a minute! As much as I love this change you can't just roll it out with the nearest hardfork. Remember all the pain of #2810. We need to:

  • pre-announce it
  • make adjustments to compilers if needed
  • add some checks/logs to the node for developers to be aware
  • wait for them to update their contracts and have ~0 warnings in logs for current blocks
  • schedule the update

Exactly, this pr is marked as blocked, so will not be merged without careful review and discussion.

Jim8y avatar Jul 26 '24 02:07 Jim8y

Will this affect calls between contracts?

Yes, it will. That is why this pr may only take effect to contracts that are depolyed or updated after the next hardfork,,,,,, will be discussed.

Jim8y avatar Jul 26 '24 02:07 Jim8y

Is not rebased? I see changes from other PRs

I am tring to fix, but still have no clue, changed that are already merged into the base branch still showing here, i tried reset, rebase, merge,,, none of them work

Jim8y avatar Dec 19 '24 10:12 Jim8y