foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Add cheatcode to set `block.blobbasefee`

Open onbjerg opened this issue 1 year ago • 2 comments

Component

Forge

Describe the feature you would like

Add a cheatcode to set block. blobbasefee, similar to how we can set other block fields.

This is a new field on block in Solidity 0.8.24, only available in Cancun.

Additional context

No response

onbjerg avatar Feb 02 '24 16:02 onbjerg

i'm unable to found the blobbasefee field, is it normal ?

i'm blocked here

impl Cheatcode for blobBaseFeeCall {
    fn apply_full<DB: DatabaseExt>(&self, ccx: &mut CheatsCtxt<DB>) -> Result {
        let Self { newBlobBaseFee } = self;

        ensure!(
            ccx.data.env.cfg.spec_id >= SpecId::CANCUN,
            "`blobBaseFee` is not supported before the Cancun hard fork; \
             see relevant EIP for blob base fee"
        );
// there isn't any blobbasefee field here, where can i found it ?

        //ccx.data.env.block. = *newBlobBaseFee;
        Ok(Default::default())
    }
}

DoTheBestToGetTheBest avatar Feb 02 '24 20:02 DoTheBestToGetTheBest

See https://github.com/bluealloy/revm/blob/93c7ba0ff619534751df2922e7e77671b79077ff/crates/primitives/src/env.rs#L467

onbjerg avatar Feb 02 '24 20:02 onbjerg