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

Fix(engine): Require chain_id #432

Merged
merged 1 commit into from
Feb 7, 2022
Merged
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
4 changes: 3 additions & 1 deletion engine-tests/src/tests/erc20_connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ impl test_utils::AuroraRunner {
],
);

let input = create_eth_transaction(Some(token.into()), Wei::zero(), input, None, &sender);
let chain_id = Some(self.chain_id);
let input =
create_eth_transaction(Some(token.into()), Wei::zero(), input, chain_id, &sender);

let result = self.evm_submit(input, origin); // create_eth_transaction()
result.check_ok();
Expand Down
4 changes: 4 additions & 0 deletions engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,10 @@ pub fn submit<I: IO + Copy, E: Env, P: PromiseHandler>(
if U256::from(chain_id) != U256::from(state.chain_id) {
return Err(EngineErrorKind::InvalidChainId.into());
}
} else {
// Do not allow missing chain_id in production
#[cfg(not(feature = "evm_bully"))]
return Err(EngineErrorKind::InvalidChainId.into());
}

// Retrieve the signer of the transaction:
Expand Down