-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
add getter, add comment and add field in event #13376
Conversation
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.
One small suggestion
uint96 amount, | ||
IERC20 billingToken |
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 we have to change this event anyway.. I think we could better "future proof" it by changing it to just include the whole RegistrationParams
struct. wdyt?
event RegistrationRequested(
bytes32 indexed hash,
RegistrationParams registrationParams
)
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.
Using registrationParams is far neater, I like it! Pasting it here for reference:
struct RegistrationParams {
address upkeepContract;
uint96 amount;
// 1 word full
address adminAddress;
uint32 gasLimit;
uint8 triggerType;
// 7 bytes left in 2nd word
IERC20 billingToken;
// 12 bytes left in 3rd word
string name;
bytes encryptedEmail;
bytes checkData;
bytes triggerConfig;
bytes offchainConfig;
}
I confirmed registrationParams contains exactly the same the params needed, except hash, which we will add.
For an Event (RegistrationRequested) which has a Struct (RegistrationParams), the hash will be just listing all the fields in the struct, so keccak(bytes32,address upkeepContract,uint96 amount,address....)?
I believe that is how it works, but double confirm @RyanRHall ?
We will need to function signature in atlas, hence confirming, but I dont think using the RegistrationParams will require any other changes except the hash. cc @cmalec
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.
ya for new versions of the event we will just need to decode RegistrationParams but should be fine.
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.
Note to myself, the event signature is now:
- RegistrationRequested(bytes32,address,uint96,address,uint32,uint8,address,string,bytes,bytes,bytes,bytes)
- 0x72319f308e224802c7dc5f4bad21a9b46070f765d25eedf39a25f04bf39eb632
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 realized that we introduced some side effects bc of this change. Given that we dont change the params in the event often, I reverted this change. More details in the other comment.
Quality Gate passedIssues Measures |
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.
LGTM 👍
bytes32 indexed hash, | ||
string name, | ||
bytes encryptedEmail, | ||
address indexed upkeepContract, |
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.
Hey @RyanRHall / @FelixFan1992 : this refactoring results in a feature change. This upkeepContract is indexed and address is recommended to be indexed, but when we wrap the params with the RegistrationParams struct, we lose this indexed address.
Not a strong opinion but I would recommend keeping the original structure to have the contract indexed and this old structure can also make the atlas changes easier/cleaner (have to replicate the struct in test).
As title, minor improvements on both registry and registrar