-
Notifications
You must be signed in to change notification settings - Fork 41
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
[TT-1936] Seth with simulated backend #1593
base: main
Are you sure you want to change the base?
Conversation
5b05013
to
13f733d
Compare
13f733d
to
e6d9102
Compare
e711af8
to
e076fb9
Compare
e076fb9
to
4af5ca6
Compare
00368fc
to
26e32d4
Compare
Quality Gate passedIssues Measures |
@@ -64,7 +65,7 @@ var ( | |||
// Client is a vanilla go-ethereum client with enhanced debug logging | |||
type Client struct { | |||
Cfg *Config | |||
Client *ethclient.Client | |||
Client simulated.Client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it replace the ethclient.Client
completely? In the dev-platform CLI we're using seth.Client
also in the production environment. Our question and request was to be able to swap the real client with a simualted one, so in unit/isolated tests we don't need to interact with Anvil (or similar), but rather in-memory simulated backend.
Here's example how we're constructing seth.Client
: https://github.com/smartcontractkit/dev-platform/blob/main/cmd/client/eth_client.go#L94
And here's example how it's used to interact with capabilities registry contract: https://github.com/smartcontractkit/dev-platform/blob/main/cmd/client/capabilities_registry_client.go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it doesn't. simulated.Client
is just an interface, you can pass *ethclient.Client
as simulated.Client
. Anyway, this only applies if you pass simulated backed explicitly to the builder like this WithEthClient(backend.Client()).
. Otherwise it will use the URL provided and start a normal client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for clarification 🙇
This PR adds support for passing
simulated.Client
implementation to Seth, which includes both a client connected to a live RPC and a Simulated Backend.Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.
Why
These changes introduce support for EIP-1559 transactions, adjust gas price estimation, and include various library updates. The modifications ensure compatibility with recent Ethereum network updates and improve the reliability of transaction processing and gas estimation.
What
seth.toml
: Enabled EIP-1559 dynamic fees for more efficient gas price management on compatible networks.seth/tracing.go
: Updated RPC dialing to use theMustFirstNetworkURL
function, ensuring the connectivity setup is more robust and error-handling is improved.go.mod
andgo.sum
: Updated dependencies for better compatibility and security. This includes updates togo-ethereum
, which contains critical fixes and improvements for blockchain interactions.seth/gas_bump_test.go
: Modified gas bumping tests to reflect changes in gas management, particularly for EIP-1559 transactions.seth/seth.toml
: Adjusted default configurations for gas prices and transaction fees to align with the new EIP-1559 structures and the current network conditions.