-
Notifications
You must be signed in to change notification settings - Fork 114
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
Post-fork transaction validation #879
Conversation
e8ad081
to
22ac212
Compare
22ac212
to
60c32bb
Compare
@@ -441,7 +441,7 @@ public synchronized TxResponse addPendingTransaction(AionTransaction tx) { | |||
} | |||
|
|||
public boolean isValid(AionTransaction tx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method can be a static method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It cannot be changed to static because of the interface for the pending state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay.
this.type = TransactionTypes.DEFAULT; | ||
// setting the default type depending on use case | ||
if (to == null) { | ||
this.type = TransactionTypes.FVM_CREATE_CODE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the AVM contract create definition?
I thought the AVM contract create address destination is null
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For AVM contracts the default transaction type value is incorrect. However, our unit tests have already been written to specify the deploy code and not use the default value when testing the AVM contract deployments. This change is mainly for the sake of the old FVM tests that were written without taking the transaction type into account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer fully removing the constructor that allows building transactions without specifying the type, but that would be a low priority refactoring that can be applied later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the explanation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left 2 comments might need to change it.
…er transactions - updated the default setting to differ depending on the use case - corrected the type setting in unit tests
81d85c5
to
1b240a9
Compare
Description
AVM_CREATE_CODE = 0x02
;Type of change
Insert x into the following checkboxes to confirm (eg. [x]):
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.
Verification
Insert x into the following checkboxes to confirm (eg. [x]):