-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Feature/istanbul #3351
Feature/istanbul #3351
Conversation
…va-tron into feature/istanbul
…into feature/istanbul * 'feature/istanbul' of github.com:tronprotocol/java-tron: refine sonar enable change delegation
…va-tron into feature/istanbul
…into feature/istanbul # Conflicts: # framework/src/test/java/org/tron/common/runtime/vm/TRC10Test.java # framework/src/test/java/org/tron/common/runtime/vm/UnStakeTest.java
} | ||
break; | ||
} | ||
case ALLOW_TVM_ASSET_ISSUE: { |
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.
There is another proposal called ALLOW_TVM_TRANSFER_TRC10
.
Should this be called ALLOW_TVM_TRC10_ISSUE
in proposal scope.
|
||
REWARDBALANCE(0xd8, 1, 1, OpCode.Tier.ExtTier), | ||
|
||
ISSRCANDIDATE(0xd9, 1, 1, OpCode.Tier.ExtTier), |
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.
better call it ISWITNESS
.
The code base has no sr candidate
but witness candidate
.
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.
ISWITNESS
will be used in future plan. We define it as a different meaning compare to this scenario.
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 already introduces inconsistency.
accountCapsule.setInstance(accountCapsule.getInstance().toBuilder().build()); | ||
// spend 1024trx for assetissue, send to blackhole address | ||
AccountCapsule bhAccountCapsule = repository.getAccount(repository.getBlackHoleAddress()); | ||
bhAccountCapsule.setBalance(Math.addExact(bhAccountCapsule.getBalance(), TOKEN_ISSUE_FEE)); |
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.
TOKEN_ISSUE_FEE
is not a constant. It's a chain parameter in dynamicProperty and is modified through proposals.
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.
Good point. Will refine this code in next release due to code freezing :)
public DataWord isContract(DataWord address) { | ||
ContractCapsule contract = getContractState() | ||
.getContract(TransactionTrace.convertToTronAddress(address.getLast20Bytes())); | ||
return contract != null ? new DataWord(1) : new DataWord(0); | ||
} | ||
|
||
public DataWord isSRCandidate(DataWord address) { |
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.
To be consistent with isContract
(ISCONTRACT) opcode, you should use the name/OpCode/Solidity function name isWitness
(ISWITNESS)`
- Contract/Witness/Normal is the type code of AccountType
- consistency across the whole TVM design really matters
|
||
ISSRCANDIDATE(0xd9, 1, 1, OpCode.Tier.ExtTier), | ||
|
||
TOKENISSUE(0xda, 1, 1, Tier.HighTier), |
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.
Since all other OpCodes are all verb-phrase, should this be ISSUETOKEN
?
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.
Will consider to rename the opcode in next release due to code freezing.
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 know that if it is released, then It will never be changed.
So sad that your release plan is more important that code and consistency.
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 can be changed. Not a hard fork case. As long as we keep the opcode hex value the same in the interpreter, it will not influence the transaction behavior and the solidity code. Just a naming issue.
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.
Minor naming change required.
And corresponding changes should be made to tronprotocol/solidity
.
What does this PR do?
Why are these changes required?
This PR has been tested by:
Follow up
Extra details