Skip to content

Conversation

@activecoder10
Copy link
Contributor

Added fetch_add_nonce method for NodeInteraction trait.
Improved logging for some components.

Copy link
Member

@xermicus xermicus left a comment

Choose a reason for hiding this comment

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

Thanks, looks good! Just some smallies

task.json_output = Some(output.output.clone());
task.error = output.error;
self.contracts.insert(output.input, output.output);
self.contracts.insert(output.input, output.output.clone());
Copy link
Member

Choose a reason for hiding this comment

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

Is the added .clone() necessary, I don't see the output being accessed further down?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, it's not necessary.

}
}
} else {
log::warn!("Compiled contracts field is None");
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the only point of this heavily nested code here is to log a warning if there were no contracts compiled? This makes sense but could be simplified a lot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it is useful to log that the contract was succesfully compiled from a file and also when we don't have any contract to compile.

.with_input(Bytes::from(code.clone()))
.with_gas_price(20_000_000_000)
.with_gas_limit(20_000_000_000)
.with_gas_price(5_000_000)
Copy link
Member

Choose a reason for hiding this comment

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

Why did you need to change this? IIRC it was arbitrary but if it has to be a specific value it would be good to have the reason as comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have changed it because I have received this message:

error code -32000: tx fee (400.00 ether) exceeds the configured cap (1.00 ether)

And this is because:

Total Fee = gas_price * gas_limit
= 20_000_000_000 * 20_000_000
= 400_000_000_000_000_000_000 (wei)
= 400 ether

And the new value will be:

0.000025 ether

/// Returns the state diff of the transaction hash in the [TransactionReceipt].
fn state_diff(&self, transaction: TransactionReceipt) -> anyhow::Result<DiffMode>;

fn fetch_add_nonce(&self, address: Address) -> anyhow::Result<u64>;
Copy link
Member

Choose a reason for hiding this comment

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

Please add a doc comment explaining what the trait method is supposed to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in the new revision

@activecoder10 activecoder10 added this pull request to the merge queue Jun 18, 2025
Merged via the queue into main with commit ee97b62 Jun 18, 2025
5 checks passed
@xermicus xermicus deleted the lv/diff-test-improvements branch June 20, 2025 08:32
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.

3 participants