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

Changed the function type of commitMetablock of Consensus contract from public to external #281

Closed

Conversation

bruce9steve
Copy link
Contributor

@bruce9steve bruce9steve commented Feb 17, 2020

fixes #245

  • Changed the function type of commitMetablock in Consensus contract from "public" to "external".

@0xsarvesh 0xsarvesh self-assigned this Feb 17, 2020
Copy link
Collaborator

@0xsarvesh 0xsarvesh left a comment

Choose a reason for hiding this comment

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

Thanks 👍
Some feedback.

// Anchor state root.
anchorStateRoot(_metachainId, _rlpBlockHeader);

CoreI core = assignments[_metachainId];
bytes32 metablockHash = goToCommittedRound(_metachainId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is call twice in below functions :

  1. assertCommit
  2. commitStateRoot

// Anchor state root.
anchorStateRoot(_metachainId, _rlpBlockHeader);

CoreI core = assignments[_metachainId];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Core address is read three times. Is it possible to optimise this?

* @param _gasTargetDelta Gas target delta to open new metablock.
* @param _kernelHash Kernel hash.
*/
function commitStateRoot(
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's more readable if event is emitted by external function instead of private.

* @param _gasTargetDelta Gas target delta to open new metablock.
* @param _kernelHash Kernel hash.
*/
function commitStateRoot(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Naming can be improved.

@0xsarvesh 0xsarvesh removed their assignment Feb 17, 2020
@bruce9steve
Copy link
Contributor Author

As discussed with @deepesh-kn I am moving this ticket to parking lot.

@benjaminbollen
Copy link
Contributor

Thanks, but I will close this.

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.

Update Consensus::commitMetablock
3 participants