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: Use actual replayed tx's gas and pubdata prices to replay tx. #319

Merged
merged 9 commits into from
Aug 6, 2024

Conversation

AnastasiiaVashchuk
Copy link
Contributor

@AnastasiiaVashchuk AnastasiiaVashchuk commented Aug 2, 2024

What 💻

  • bump zksync era dependencies version
  • new get_block_gas_details in fork.rs to extract l1 batch gas info.
  • modify create_l1_batch_env to construct BatchFeeInput from values taken from l1 batch details, if memory node is running in fork mode.

Why ✋

Context: successful txs from fork fails while replaying them with node.
This is caused by wrong gas/fee values stored in fee_input_provider that are used to calculate tx cost.

zksync_utils = { git = "https://github.com/matter-labs/zksync-era.git", rev = "e10bbdd1e863962552f37e768ae6af649353e4ea" }
zksync_state = { git = "https://github.com/matter-labs/zksync-era.git", rev = "e10bbdd1e863962552f37e768ae6af649353e4ea" }
zksync_web3_decl = { git = "https://github.com/matter-labs/zksync-era.git", rev = "e10bbdd1e863962552f37e768ae6af649353e4ea", features = [
zksync_basic_types = { git = "https://github.com/matter-labs/zksync-era.git", rev = "0d51cd6f3e65eef1bda981fe96f3026d8e12156d" }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in this commit there was added fair_pubdata_price value, that is needed for replaying transaction.
more details here:
matter-labs/zksync-era#2244

"server",
"client",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zksync_web3_decl does not support client feature on this commit

@AnastasiiaVashchuk AnastasiiaVashchuk marked this pull request as ready for review August 2, 2024 11:58
@AnastasiiaVashchuk AnastasiiaVashchuk requested a review from a team as a code owner August 2, 2024 11:58
src/node/eth.rs Outdated Show resolved Hide resolved
Comment on lines +268 to 271
Web3Error::InternalError(_) | Web3Error::MethodNotImplemented => {
ErrorCode::InternalError
}
Web3Error::NoBlock
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are caused by bumping the version of zksync_ dependencies

Comment on lines +1429 to +1441
let hash = match tx_req.get_tx_hash() {
Ok(result) => result,
Err(e) => {
tracing::error!("Transaction request serialization error: {}", e);
return futures::future::err(into_jsrpc_error(Web3Error::SerializationError(e)))
.boxed();
}
};
let bytes = match tx_req.get_signed_bytes(&PackedEthSignature::from_rsv(
&H256::default(),
&H256::default(),
27,
)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are caused by bumping the version of zksync_ dependencies

mm-zk
mm-zk previously approved these changes Aug 6, 2024
src/fork.rs Show resolved Hide resolved
src/fork.rs Outdated Show resolved Hide resolved
@AnastasiiaVashchuk AnastasiiaVashchuk merged commit 2a6ea11 into main Aug 6, 2024
10 checks passed
@AnastasiiaVashchuk AnastasiiaVashchuk deleted the anastasiia-fix-replay branch August 6, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants