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

Sync neo #517

Merged
merged 70 commits into from
Mar 1, 2021
Merged

Sync neo #517

merged 70 commits into from
Mar 1, 2021

Conversation

bettybao1209
Copy link
Contributor

@bettybao1209 bettybao1209 commented Feb 8, 2021

Close #519

1. Needs to add a new message type GetInstance in LocalNode class;
2. UpdateExtensibleWitnessWhiteList in Blockchain class and Verify in ExtensiblePayload class should be public, since they are needed in DBFT plugin.
3. https://github.com/neo-project/neo/blob/master/src/neo/SmartContract/Native/LedgerContract.cs#L72 will throw NullReferenceException, which is caused by the non-existence of the CreateStorageKey(Prefix_CurrentBlock) (invoked before PostPersist).

@erikzhang
Copy link
Member

Verify in ExtensiblePayload class should be public, since they are needed in DBFT plugin.

Why do you need Verify? The payloads are verified before you receive.

@bettybao1209 bettybao1209 changed the title Sync neo2302 Sync neo Feb 12, 2021
@erikzhang
Copy link
Member

@bettybao1209 Can you fix the checks?

@cloud8little
Copy link
Contributor

@Qiao-Jin and I Debug and find it failed in VerifyWitnesses.

https://github.com/neo-project/neo/blob/master/src/neo/Network/P2P/Payloads/ExtensiblePayload.cs#L98

        internal bool Verify(ProtocolSettings settings, DataCache snapshot, ISet<UInt160> extensibleWitnessWhiteList)
        {
            uint height = NativeContract.Ledger.CurrentIndex(snapshot);
            if (height < ValidBlockStart || height >= ValidBlockEnd) return false;
            if (!extensibleWitnessWhiteList.Contains(Sender)) return false;
            return this.VerifyWitnesses(settings, snapshot, 0_02000000);
        }

because it return false here:
https://github.com/neo-project/neo/blob/master/src/neo/SmartContract/Helper.cs#L235

                engine.LoadScript(invocationScript, configureState: p => p.CallFlags = CallFlags.None);

                if (engine.Execute() == VMState.FAULT) return false;
                if (!engine.ResultStack.Peek().GetBoolean()) return false;
                fee = engine.GasConsumed;

@erikzhang do you have any insight?

@erikzhang
Copy link
Member

Please test it with neo-project/neo#2367.

@superboyiii superboyiii merged commit d0db5a4 into neo-project:master Mar 1, 2021
@bettybao1209 bettybao1209 deleted the sync-neo2302 branch March 1, 2021 03:12
joeqian10 pushed a commit to joeqian10/neo-modules that referenced this pull request Apr 7, 2021
* get baseexception message

* remove singletons

* fix

* update nuget

* fix

* sync neo2308

* fix ut

* format

* remove unused using

* allow multi systems

* remove settings in policycontract and some fixes

* format

* Fix ApplicationLogs

* Fix DBFTPlugin

* Use ushort.MaxValue

* update settings

* format

* Remove empty line

* Update verify

* fix RpcNep17Tracker and optimize

* fix ut

* Rename

* add auto-start and settings

* null case

* optimize

* Remove ConsensusService.node

* format

* update ConsensusService

* Revert some changes

* update ConsensusService.cs

* optimize based on review

* fix consensus service

* update settings in sdk

* Fix storages

* Reorder

* Fix snapshot

* Remove network from StateDumper

* allow multi protocolsettings in rpcclient

* optimize

* sync and minor fix

* Fix snapshot for OracleService

* fix

* Use ProtocolSettings.Default in RpcClient

* Fix WalletAPI

* Fix snapshot for RpcServer

* remove magic in rpcclient

* Fix snapshot for RpcServer

* Fix DummyWallet

* Allow start multiply RpcServers

* Fix RpcServerPlugin.RegisterMethods

* Fix NativeContractToJson

* Fix StatesDumper

Co-authored-by: Erik Zhang <[email protected]>
Co-authored-by: Shargon <[email protected]>
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.

neo modules doesn't compile against neo master
7 participants