-
Notifications
You must be signed in to change notification settings - Fork 105
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
Expose deployment block number of stake table contracts to clients #2647
Conversation
See comments in `InitializedAt.sol` for reasons for this change.
Responding to discussion with @alxiong. This maybe simpler to reason about and does not piggyback on openzeppelin's Initializable event.
constructor() { | ||
initialize(); | ||
} | ||
|
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.
wait, shouldn't the upgradable's constructor be:
constructor() {
_disableInitializers();
}
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.
Based on the documentation https://docs.openzeppelin.com/contracts/4.x/api/proxy#Initializable-_disableInitializers--
I think this is equivalent, because this constructor calls the initializer, and the initializer cannot be called again so the contract is never not initialized. When we inherit from this contract in other contracts the constructor of this contract is not called unless manually invoked which is just something we must not do.
Let me add a test for it.
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 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
See comments in
InitializedAt.sol
for reasons for this change.Some more background. When querying infura or alchemy for logs there are limits, for infura its
for alchemy its
The way to limit queries is to specify a
from
and ato
block. However, absent any other information there is no good value for thefrom
block.Clients can now read
initializedAtBlock
and start fetching events from that block.