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

Avm now handles "pure" balance transfers #848

Merged
merged 3 commits into from
Mar 15, 2019

Conversation

aionick
Copy link
Contributor

@aionick aionick commented Mar 14, 2019

Description

  • Formerly, transactions that simply transferred balance to an address that is not a contract were executed by the Fvm. Now they are executed by the Avm.
  • This now mean that a CALL transaction is avm-bound if: the call is to an avm contract or to a non-contract address.
  • Some minor refactorings to the BulkExecutor; namely, removing the unnecessary isTransactionForFvm() method which must simply return !isTransactionForAvm().
  • There is a discrepancy between vm's handling the pay miner fees & refund sender. The Avm does this whereas the Fvm does not (will open an issue for this soon). This explains the other logic change in the BulkExecutor, which only does these actions if the transaction is not avm-bound.

The actual changes to logic are in commit b177d64 (the other commit, b61bc8c contains tests).

Type of change

Insert x into the following checkboxes to confirm (eg. [x]):

  • Bug fix.
  • New feature.
  • Enhancement.
  • Unit test.
  • Breaking change (a fix or feature that causes existing functionality to not work as expected).
  • Requires documentation update.

Testing

Please describe the tests you used to validate this pull request. Provide any relevant details for test configurations as well as any instructions to reproduce these results.

  • A number of consensus tests were added before making the change, in the first commit here, to ensure consensus was not broken. The test harness also contains some tests on balance transfers (soon to be pushed)

Verification

Insert x into the following checkboxes to confirm (eg. [x]):

  • I have self-reviewed my own code and conformed to the style guidelines of this project.
  • New and existing tests pass locally with my changes.
  • I have added tests for my fix or feature.
  • I have made appropriate changes to the corresponding documentation.
  • My code generates no new warnings.
  • Any dependent changes have been made.

Copy link
Contributor

@aion-kelvin aion-kelvin left a comment

Choose a reason for hiding this comment

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

looks pretty sane. have some questions/suggestions in-line; they're not really blockers for me, but take a look before pushing.

@aionick
Copy link
Contributor Author

aionick commented Mar 15, 2019

I won't have time to do the assertThat change, I'll try to keep it in mind in the future

nextBatchToExecute =
fetchNextBatchOfTransactionsForAionVirtualMachine(currentIndex);
fetchNextBatchOfTransactionsForFastVirtualMachine(currentIndex);
Copy link
Collaborator

@AionJayT AionJayT Mar 15, 2019

Choose a reason for hiding this comment

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

reason for reversing avm fvm order in the if-else condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just seems more natural to do if (condition) instead of if (!condition)

Copy link
Contributor

@AlexandraRoatis AlexandraRoatis left a comment

Choose a reason for hiding this comment

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

pending corrections to the formatting

@AionJayT
Copy link
Collaborator

please fix the conflict. Thanks

Copy link
Collaborator

@AionJayT AionJayT left a comment

Choose a reason for hiding this comment

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

Overall LGTM. We merge it after the conflict been fixed.

Copy link
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

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

Didn't take a very close look, but it looks good to me!

aionick added 3 commits March 15, 2019 17:09
- These consensus tests anticipate the next commit, which seeks to move
  "pure balance transfers" to the Avm instead of the Fvm.
- These are also just going to be valuable to have going forward.
- A pure balance transfer is just a balance transfer to a non-contract address.
  Formerly these were handled by the Fvm, now they are handled by the Avm.
@aionick aionick force-pushed the nick-balance-transfer branch from b177d64 to c843595 Compare March 15, 2019 21:15
@AionJayT AionJayT self-requested a review March 15, 2019 21:44
@AionJayT AionJayT merged commit 8e38ca5 into master-pre-merge Mar 15, 2019
@AionJayT AionJayT deleted the nick-balance-transfer branch March 20, 2019 19:18
@AionJayT AionJayT modified the milestones: 0.4.0, 0.3.4 Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants