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

feat(consensus): add consensus logic optimization proposal #6141

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

zeusoo001
Copy link
Contributor

What does this PR do?
Add consensus logic optimization proposal.

Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

if (!forkController.pass(ForkBlockVersionEnum.VERSION_4_8_0)) {
throw new ContractValidateException(
"Bad chain parameter id [CONSENSUS_LOGIC_OPTIMIZATION]");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

[CONSENSUS_LOGIC_OPTIMIZATION] has been valid, no need to propose again.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I have seen many proposals that do not implement this judgment logic, such as ALLOW_TVM_SHANGHAI, ALLOW_OPTIMIZED_RETURN_VALUE_OF_CHAIN_ID

new BytesCapsule(ByteArray.fromLong(value)));
}

public long getConsensusLogicOptimization() {
Copy link
Contributor

Choose a reason for hiding this comment

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

public boolean allowConsensusLogicOptimization() {
return getConsensusLogicOptimization() == 1L;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

@@ -27,6 +24,8 @@
import org.tron.core.capsule.BlockCapsule;
import org.tron.core.capsule.WitnessCapsule;

import static org.tron.core.config.Parameter.ChainConstant.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

check style do not allow *

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, but the local check style is passed.

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.

4 participants