Skip to content
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

Change ChainID width to 64 bit #420

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ and this project adheres to [Semantic Versioning].
### Added

- Support for Istanbul EIP-1344 (CHAINID opcode). `chain_id` added to `evmc_tx_context` struct.
[[#375](https://github.com/ethereum/evmc/pull/375)]
[[#375](https://github.com/ethereum/evmc/pull/375),
[#420](https://github.com/ethereum/evmc/pull/420)]
- Support for Istanbul EIP-1884 (Repricing for trie-size-dependent opcodes).
[[#372](https://github.com/ethereum/evmc/pull/372)]
- The **Berlin** EVM revision has been added.
Expand Down
4 changes: 2 additions & 2 deletions bindings/go/evmc/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type TxContext struct {
Timestamp int64
GasLimit int64
Difficulty common.Hash
ChainID common.Hash
ChainID uint64
}

type HostContext interface {
Expand Down Expand Up @@ -182,7 +182,7 @@ func getTxContext(pCtx unsafe.Pointer) C.struct_evmc_tx_context {
C.int64_t(txContext.Timestamp),
C.int64_t(txContext.GasLimit),
evmcBytes32(txContext.Difficulty),
evmcBytes32(txContext.ChainID),
C.uint64_t(txContext.ChainID),
}
}

Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/evmc-vm/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mod tests {
block_timestamp: 0,
block_gas_limit: 0,
block_difficulty: Uint256::default(),
chain_id: Uint256::default(),
chain_id: 0,
}
}

Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/evmc-vm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ mod tests {
block_timestamp: 235117,
block_gas_limit: 105023,
block_difficulty: Uint256 { bytes: [0xaa; 32] },
chain_id: Uint256::default(),
chain_id: 0,
}
}

Expand Down
2 changes: 1 addition & 1 deletion include/evmc/evmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ struct evmc_tx_context
int64_t block_timestamp; /**< The block timestamp. */
int64_t block_gas_limit; /**< The block gas limit. */
evmc_uint256be block_difficulty; /**< The block difficulty. */
evmc_uint256be chain_id; /**< The blockchain's ChainID. */
uint64_t chain_id; /**< The blockchain's ChainID. */
};

struct evmc_context;
Expand Down