Skip to content
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

Fix native serialize #1988

Merged
merged 40 commits into from
Oct 19, 2020
Merged

Fix native serialize #1988

merged 40 commits into from
Oct 19, 2020

Conversation

shargon
Copy link
Member

@shargon shargon commented Oct 4, 2020

Refactor of #1983

@shargon shargon requested a review from erikzhang October 4, 2020 10:06
@shargon
Copy link
Member Author

shargon commented Oct 4, 2020

@erikzhang I only keep the neoToken changes because it will not be accessible outside of the contract, and we can have more than expected values, I also think we can also change the id of the oracles, because 32 is too small for this list.

src/neo/Ledger/StorageItem.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/Oracle/OracleContract.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/Oracle/OracleContract.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/PolicyContract.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/Tokens/NeoToken.cs Outdated Show resolved Hide resolved
@shargon shargon mentioned this pull request Oct 10, 2020
src/neo/Ledger/StorageItem.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/PolicyContract.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/PolicyContract.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/Tokens/NeoToken.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/Tokens/NeoToken.cs Outdated Show resolved Hide resolved
src/neo/SmartContract/Native/Tokens/NeoToken.cs Outdated Show resolved Hide resolved
@superboyiii superboyiii mentioned this pull request Oct 15, 2020
44 tasks
@@ -86,7 +87,7 @@ public T GetInteroperable<T>() where T : IInteroperable, new()
if (cache is null)
{
var interoperable = new T();
interoperable.FromStackItem(BinarySerializer.Deserialize(value, 16, 34));
interoperable.FromStackItem(BinarySerializer.Deserialize(value, ExecutionEngineLimits.Default.MaxStackSize, ExecutionEngineLimits.Default.MaxItemSize));
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that it's better to preserve the vm limits.

@shargon shargon merged commit 22f80a7 into neo-project:master Oct 19, 2020
@shargon shargon deleted the fix-native-serialize branch October 19, 2020 07:55
Qiao-Jin added a commit to Qiao-Jin/neo that referenced this pull request Oct 23, 2020
ShawnYun pushed a commit to ShawnYun/neo that referenced this pull request Jan 8, 2021
* Fix native serialize

* Update src/neo/SmartContract/Native/Oracle/OracleContract.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Update OracleContract.cs

* Remove sorting with BigEndian

* Fix foreach without sort

* Fix calculate bonus

* Remove foreach

* Follow roman feedback

* Return iterator for GetBlockedAccounts

* dotnet format

* Remove method and update nuget

* Revert ArrayWrapper

* Fix UT

* Update

* Use find range

* Remove internal

* Store blocked accounts in chunks

* Changed to const

* Optimize

* Change to 200 and optimize

* Optimize II

* Optimize NeoToken changes

* Clean code

* One record one key

* Clean code

* Rename

* Update IsBlocked

* Remove ordering

* Fix ut

* Optimization

* Revert include endKey

* Revert include endKey

* add yield break

* Update NeoToken.cs

* Update src/neo/SmartContract/Native/Tokens/NeoToken.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Remove +1

Co-authored-by: Erik Zhang <erik@neo.org>
cloud8little pushed a commit to cloud8little/neo that referenced this pull request Jan 24, 2021
* Fix native serialize

* Update src/neo/SmartContract/Native/Oracle/OracleContract.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Update OracleContract.cs

* Remove sorting with BigEndian

* Fix foreach without sort

* Fix calculate bonus

* Remove foreach

* Follow roman feedback

* Return iterator for GetBlockedAccounts

* dotnet format

* Remove method and update nuget

* Revert ArrayWrapper

* Fix UT

* Update

* Use find range

* Remove internal

* Store blocked accounts in chunks

* Changed to const

* Optimize

* Change to 200 and optimize

* Optimize II

* Optimize NeoToken changes

* Clean code

* One record one key

* Clean code

* Rename

* Update IsBlocked

* Remove ordering

* Fix ut

* Optimization

* Revert include endKey

* Revert include endKey

* add yield break

* Update NeoToken.cs

* Update src/neo/SmartContract/Native/Tokens/NeoToken.cs

Co-authored-by: Erik Zhang <erik@neo.org>

* Remove +1

Co-authored-by: Erik Zhang <erik@neo.org>
ixje added a commit to CityOfZion/neo-mamba that referenced this pull request Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants