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

rc-v1.0.1-stable proposed bytecode optimization to merge into stable branch #91

Merged
merged 12 commits into from
Nov 14, 2024

Conversation

roleengineer
Copy link
Contributor

Made a few slight adjustments to optimize bytecode size by consolidating some repeating code patterns. This should help streamline the overall efficiency without impacting functionality.

@benjaminbollen
Copy link
Member

@roleengineer I moved this to a new epic #93 because I think that if we propose improvements, we should first setup measurements and CI regression checks, no?

@benjaminbollen benjaminbollen changed the base branch from rc-v1.0.1-stable to candidate/stable November 13, 2024 16:02
@benjaminbollen
Copy link
Member

changed the target branch to candidate/stable as the new "develop" for the stable candidate

@benjaminbollen
Copy link
Member

if #94 is correct and merged then hopefully here we will have the CI activated @roleengineer

Copy link
Member

@benjaminbollen benjaminbollen left a comment

Choose a reason for hiding this comment

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

This all looks good to me; I would want to use this opportunity to first get measurements in our CI pipeline so that we have a record of what are improvements, and where are regressions

@@ -114,10 +114,7 @@ abstract contract ERC1155 is DiscountedBalances, Context, ERC165, IERC1155, IERC
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes memory _data) public {
address sender = _msgSender();
Copy link
Member

Choose a reason for hiding this comment

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

as mentioned before, I tried to not update this forked contract from open zepellin unless where functionally needed. that said, sure this seems like a fair readability improvement.

It would be good to have measurements in place in CI so we can see whether this increases or reduces different metrics. I don't want to walk blind for optimisations

@@ -91,10 +91,7 @@ contract DiscountedBalances is Demurrage {
// revert CirclesDemurrageAmountExceedsMaxUint192(_account, _id, _balance, 0);
revert CirclesErrorAddressUintArgs(_account, _id, 0x81);
}
DiscountedBalance memory discountedBalance = discountedBalances[_id][_account];
Copy link
Member

Choose a reason for hiding this comment

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

this is possibly an improvement, but as mentioned some of these changes were done on recommendation of reviewers. so my general comment holds, i would like to start measuring explicitly to see what is an optimisation in numbers

@benjaminbollen benjaminbollen marked this pull request as draft November 13, 2024 19:05
@benjaminbollen benjaminbollen marked this pull request as ready for review November 13, 2024 19:05
@benjaminbollen
Copy link
Member

(trying to trigger CI fyi)

Copy link
Member

@benjaminbollen benjaminbollen left a comment

Choose a reason for hiding this comment

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

LGTM. now with an initial print of gas diffs!

@benjaminbollen benjaminbollen merged commit df6c07b into candidate/stable Nov 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants