Skip to content

Remove exception from GetInvocationCounter#1948

Merged
shargon merged 5 commits intoneo-project:masterfrom
shargon:remove-exception-get-invocationcounter
Sep 23, 2020
Merged

Remove exception from GetInvocationCounter#1948
shargon merged 5 commits intoneo-project:masterfrom
shargon:remove-exception-get-invocationcounter

Conversation

@shargon
Copy link
Member

@shargon shargon commented Sep 21, 2020

Close #1930

@shargon shargon requested a review from erikzhang September 21, 2020 19:23
erikzhang
erikzhang previously approved these changes Sep 22, 2020
@roman-khimov
Copy link
Contributor

roman-khimov commented Sep 22, 2020

Scenario. A and B are contracts, A has verify method. In this verify method A calls B and B also calls A. We use A to verify some transaction, so upon running the verification script we get an evaluation stack that looks like this (invocation script not included): A¹ -> B -> A². With this change if A² is to call GetInvocationCounter the result would depend on whether A¹ called GetInvocationCounter or not, it could either be 1 or 2.

What I was thinking more wrt this bug is initializing invocationCounter before A¹ is run (in LoadScript probably).

@shargon
Copy link
Member Author

shargon commented Sep 22, 2020

Please, take a look @roman-khimov

@roman-khimov
Copy link
Contributor

LoadContext part seems to be fine (but maybe all of CallContractInternal logic related to invocationCount could be moved there?), not sure we need to change GetInvocationCounter.

@shargon shargon merged commit 7d77cab into neo-project:master Sep 23, 2020
@shargon shargon deleted the remove-exception-get-invocationcounter branch September 23, 2020 08:25
ShawnYun pushed a commit to ShawnYun/neo that referenced this pull request Jan 8, 2021
* Remove exception from GetInvocationCounter

* Ensure invocationCounter

* Optimize

Co-authored-by: erikzhang <erik@neo.org>
cloud8little pushed a commit to cloud8little/neo that referenced this pull request Jan 24, 2021
* Remove exception from GetInvocationCounter

* Ensure invocationCounter

* Optimize

Co-authored-by: erikzhang <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.

Remove exception throwing from System.Runtime.GetInvocationCounter

3 participants