Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Fix Runtime.Trigger and Transaction.GetType syscalls #957

Merged
merged 2 commits into from
Jun 5, 2019
Merged

Fix Runtime.Trigger and Transaction.GetType syscalls #957

merged 2 commits into from
Jun 5, 2019

Conversation

ixje
Copy link
Member

@ixje ixje commented Jun 5, 2019

What current issue(s) does this address, or what feature is it adding?
The ongoing audit showed a deviation in gas consumption for Testnet block 449841.
Both RunTime.Trigger and Transaction.GetType are supposed to push integers to the stack, neo-python pushed bytes. For the majority of time this worked well, but the mentioned block showed a contract where a NUMEQUAL instruction would fail the comparison in neo-python whereas neo-cli passed. This caused the next instruction JMPIFNOT to take a different branch and the rest is history.

How did you solve this problem?
pushing int's instead of bytes.

How did you make sure your solution works?
audit of the block now passes (=gas consumption equals neo-cli)

Are there any special changes in the code that we should be aware of?
no

Please check the following, if applicable:

  • Did you add any tests?
  • Did you run make lint?
  • Did you run make test?
  • Are you making a PR to a feature branch or development rather than master?
  • Did you add an entry to CHANGELOG.rst? (if not, please do)

@ixje ixje merged commit 60c8f8c into CityOfZion:development Jun 5, 2019
@ixje ixje deleted the fix-trigger-txtype branch June 5, 2019 17:30
@coveralls
Copy link

Coverage Status

Coverage remained the same at 85.095% when pulling 8b4b894 on ixje:fix-trigger-txtype into 9d3b4a0 on CityOfZion:development.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants