# Evm.setBlockAndExecutionConfig

Replaces the block environment, the specification, and its version together.

The one call for a caller advancing to a block that also changes the rules, so neither half is briefly applied without the other.

## Imports

:::code-group
```ts [Named]
import { Evm } from 'ox/evm'
```

```ts [Entrypoint]
import * as Evm from 'ox/evm/Evm'
```
:::

## Examples

```ts twoslash
// @noErrors
import { Evm } from 'ox/evm'

Evm.setBlockAndExecutionConfig(evm, {
  block: { number: 21_000_000n },
  specId: 'osaka'
})
```

## Definition

```ts
function setBlockAndExecutionConfig<asynchronous>(
  evm: Evm<asynchronous>,
  options: setBlockAndExecutionConfig.Options,
): Awaitable<asynchronous, void>
```

**Source:** [src/evm/Evm.ts](https://github.com/wevm/ox/blob/main/src/evm/Evm.ts#L740)

## Parameters

### evm

* **Type:** `Evm<asynchronous>`

EVM to reconfigure.

#### evm.'~async'

* **Type:** `asynchronous`

#### evm.'~chainId'

* **Type:** `bigint`

#### evm.'~config'

* **Type:** `{ block: Block; specId: "frontier" | "homestead" | "tangerine" | "spuriousDragon" | "byzantium" | "petersburg" | "istanbul" | "berlin" | "london" | "merge" | "shanghai" | "cancun" | "prague" | "osaka" | "amsterdam"; version?: Version; }`

The engine's current execution config.

Held so a setter can replace one half without discarding the other, since
the adapter's operation carries both.

#### evm.'~driver'

* **Type:** `asynchronous extends true ? Driver : undefined`

Drives the asynchronous source, when there is one.

#### evm.'~engine'

* **Type:** `Engine`

#### evm.block

* **Type:** `Block`

#### evm.specId

* **Type:** `"frontier" | "homestead" | "tangerine" | "spuriousDragon" | "byzantium" | "petersburg" | "istanbul" | "berlin" | "london" | "merge" | "shanghai" | "cancun" | "prague" | "osaka" | "amsterdam"`

#### evm.version

* **Type:** `Version`
* **Optional**

### options

* **Type:** `setBlockAndExecutionConfig.Options`

Block, specification, and version to apply.

#### options.block

* **Type:** `Block`
* **Optional**

Block values to apply.

#### options.specId

* **Type:** `"frontier" | "homestead" | "tangerine" | "spuriousDragon" | "byzantium" | "petersburg" | "istanbul" | "berlin" | "london" | "merge" | "shanghai" | "cancun" | "prague" | "osaka" | "amsterdam"`
* **Optional**

Specification whose rules apply. Unchanged when omitted.

#### options.version

* **Type:** `Version`
* **Optional**

Overrides applied on top of that specification.

## Return Type

`Awaitable<asynchronous, void>`
