-
Notifications
You must be signed in to change notification settings - Fork 28
Add permit functions for flashblocks number contract #287
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
base: flashtestations-permit
Are you sure you want to change the base?
Conversation
6499f4f
to
f93045b
Compare
} | ||
|
||
fn estimate_flashblock_number_tx_gas( | ||
fn current_flashblock_number( |
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.
Let's add docs
Will this function just returns current flashblock number? If so why does it needs mutable ref to state?
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.
getting the tx nonce needs mutable ref. pub fn get_nonce(
db: &mut State,
address: Address,
) -> Result<u64, BuilderTransactionError> {
db.load_cache_account(address)
.map(|acc| acc.account_info().unwrap_or_default().nonce)
.map_err(|_| BuilderTransactionError::AccountLoadFailed(address))
}
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.
not sure if there's a way to do evm.transact without a signed tx?
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.
then the read only contract calls only need the call data
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.
If you want this to be not mutable - you need to use basic_ref
function (that implemented for DatabaseRef
)
75e520c
to
ef81cca
Compare
82c5fea
to
e79a2c9
Compare
📝 Summary
permit calls to flashblocks number contract if flashtestations are enabled as well. default to regular flashblocks number contract if flashtestations are not enabled.
--flashblocks.flashblocks-number-contract-use-permit
flag to enable.✅ I have completed the following steps:
make lint
make test