neo icon indicating copy to clipboard operation
neo copied to clipboard

[N3] Request blocked funds

Open shargon opened this issue 5 months ago • 10 comments

Description

Adds a function to recover locked funds after one year, requiring approval from 19 of 21 committee nodes. This recovery can only be executed once the period has elapsed and enforces the signature requirement to ensure security and consensus.

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)
  • [x] New feature (non-breaking change which adds functionality)
  • [x] 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?

  • [ ] Unit Testing
  • [ ] Run Application
  • [ ] Local Computer Tests
  • [x] No Testing

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

shargon avatar Nov 21 '25 11:11 shargon

Looks good to me. Need #4271

erikzhang avatar Nov 22 '25 03:11 erikzhang

Regarding waiting time, please vote. Six months = 👍, one year = ❤️, two years = 🎉.

erikzhang avatar Nov 25 '25 12:11 erikzhang

Regarding waiting time, please vote. Six months = 👍, one year = ❤️, two years = 🎉.

Can one year be equivalent to the MaxTraceableBlocks? It's not the same, but it seems reasonable.

shargon avatar Nov 27 '25 13:11 shargon

Can one year be equivalent to the MaxTraceableBlocks? It's not the same, but it seems reasonable.

I think they are two different things.

erikzhang avatar Nov 27 '25 14:11 erikzhang

Need update UT for UT_NativeContract.cs Policy manifest now is the below one since new methods are added:

{"PolicyContract", """{"id":-7,"updatecounter":0,"hash":"0xcc5e4edd9f5f8dba8bb65734541df7a1c081c67b","nef":{"magic":860243278,"compiler":"neo-core-v3.0","source":"","tokens":[],"script":"EEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQBBBGvd7Z0AQQRr3e2dAEEEa93tnQA==","checksum":2426471238},"manifest":{"name":"PolicyContract","groups":[],"features":{},"supportedstandards":[],"abi":{"methods":[{"name":"blockAccount","parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","offset":0,"safe":false},{"name":"getAttributeFee","parameters":[{"name":"attributeType","type":"Integer"}],"returntype":"Integer","offset":7,"safe":true},{"name":"getBlockedAccounts","parameters":[],"returntype":"InteropInterface","offset":14,"safe":true},{"name":"getExecFeeFactor","parameters":[],"returntype":"Integer","offset":21,"safe":true},{"name":"getExecPicoFeeFactor","parameters":[],"returntype":"Integer","offset":28,"safe":true},{"name":"getFeePerByte","parameters":[],"returntype":"Integer","offset":35,"safe":true},{"name":"getMaxTraceableBlocks","parameters":[],"returntype":"Integer","offset":42,"safe":true},{"name":"getMaxValidUntilBlockIncrement","parameters":[],"returntype":"Integer","offset":49,"safe":true},{"name":"getMillisecondsPerBlock","parameters":[],"returntype":"Integer","offset":56,"safe":true},{"name":"getRecoverOfFunds","parameters":[],"returntype":"InteropInterface","offset":63,"safe":true},{"name":"getStoragePrice","parameters":[],"returntype":"Integer","offset":70,"safe":true},{"name":"getWhitelistFeeContracts","parameters":[],"returntype":"InteropInterface","offset":77,"safe":true},{"name":"isBlocked","parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","offset":84,"safe":true},{"name":"recoverFundsFinish","parameters":[{"name":"account","type":"Hash160"},{"name":"extraTokens","type":"Array"}],"returntype":"Void","offset":91,"safe":false},{"name":"recoverFundsStart","parameters":[{"name":"account","type":"Hash160"}],"returntype":"Void","offset":98,"safe":false},{"name":"removeWhitelistFeeContract","parameters":[{"name":"contractHash","type":"Hash160"},{"name":"method","type":"String"},{"name":"argCount","type":"Integer"}],"returntype":"Void","offset":105,"safe":false},{"name":"setAttributeFee","parameters":[{"name":"attributeType","type":"Integer"},{"name":"value","type":"Integer"}],"returntype":"Void","offset":112,"safe":false},{"name":"setExecFeeFactor","parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","offset":119,"safe":false},{"name":"setFeePerByte","parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","offset":126,"safe":false},{"name":"setMaxTraceableBlocks","parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","offset":133,"safe":false},{"name":"setMaxValidUntilBlockIncrement","parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","offset":140,"safe":false},{"name":"setMillisecondsPerBlock","parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","offset":147,"safe":false},{"name":"setStoragePrice","parameters":[{"name":"value","type":"Integer"}],"returntype":"Void","offset":154,"safe":false},{"name":"setWhitelistFeeContract","parameters":[{"name":"contractHash","type":"Hash160"},{"name":"method","type":"String"},{"name":"argCount","type":"Integer"},{"name":"fixedFee","type":"Integer"}],"returntype":"Void","offset":161,"safe":false},{"name":"unblockAccount","parameters":[{"name":"account","type":"Hash160"}],"returntype":"Boolean","offset":168,"safe":false}],"events":[{"name":"MillisecondsPerBlockChanged","parameters":[{"name":"old","type":"Integer"},{"name":"new","type":"Integer"}]},{"name":"WhitelistFeeChanged","parameters":[{"name":"contract","type":"Hash160"},{"name":"method","type":"String"},{"name":"argCount","type":"Integer"},{"name":"fee","type":"Any"}]}]},"permissions":[{"contract":"*","methods":"*"}],"trusts":[],"extra":null}}"""},

superboyiii avatar Dec 03 '25 09:12 superboyiii

Fix tests on https://github.com/shargon/neo/pull/19

ajara87 avatar Dec 06 '25 21:12 ajara87

Please @superboyiii check it again

shargon avatar Dec 07 '25 09:12 shargon

Regarding waiting time, please vote. Six months = 👍, one year = ❤️, two years = 🎉.

I think one year has won :)

ajara87 avatar Dec 08 '25 21:12 ajara87

Now we have new events, we need update manifest in UT.

superboyiii avatar Dec 12 '25 02:12 superboyiii

  • @AnnaShaleva all your concers was fixed.
  • @superboyiii ut fixed as wel.

shargon avatar Dec 12 '25 11:12 shargon

Now we have new exception: 60e23ef99d1ff840ef32bce602945463

superboyiii avatar Dec 17 '25 03:12 superboyiii

I guess somewhere prepared data is polluted. Workflow run tests in parallel,that's different from our PC.

superboyiii avatar Dec 22 '25 08:12 superboyiii

The others are all good. Tested.

superboyiii avatar Dec 24 '25 06:12 superboyiii