Skip to content

Add Isthmus ERC-20 bridge devnet-sdk test#14631

Closed
teddyknox wants to merge 6 commits intodevelopfrom
devnet-sdk-test-porting-1
Closed

Add Isthmus ERC-20 bridge devnet-sdk test#14631
teddyknox wants to merge 6 commits intodevelopfrom
devnet-sdk-test-porting-1

Conversation

@teddyknox
Copy link
Contributor

@teddyknox teddyknox commented Mar 4, 2025

This PR ports a few tests from the op-e2e test framework to the devnet-sdk framework, and makes a few necessary changes to the devnet-sdk framework. Since devnet-sdk tests are not run as part of CI yet, you can run tests with the following procedure.

Running devnet-sdk tests in kurtosis-devnet/tests

cd kurtosis-devnet
just isthmus-devnet
DEVNET_ENV_URL=kt://isthmus-devnet/devnet go test -v ./tests/...

You will see certain tests get skipped because they target a different fork than simple-devnet runs (Holocene). Feel free to try with different devnets.

Change Summary

  1. New Test Files Added:

    • tests/fees/fees_test.go: Tests for L1 and L2 fee calculations across different fork configurations (pre-regolith, regolith, ecotone, fjord)
    • tests/fjord/check_scripts_test.go: Tests for the check-fjord script functionality
    • tests/isthmus/erc20_bridge_test.go: Tests for ERC20 token bridging between L1 and L2 chains
    • tests/isthmus/withdrawal_root_test.go: Tests that the withdrawal root is properly set on the block header as a withdrawal is performed.
  2. Core Framework Enhancements:

    • Added new chain interface methods in devnet-sdk/system/interfaces.go:
      • ChainConfig()
      • BlockByNumber()
      • LatestBlock()
      • BlockByHash()
      • Addresses()
    • Enhanced Artifact struct in devnet-sdk/kt/fs/fs.go with improved file extraction capabilities (allows multiple reads from a single artifact object).
    • Added new fork validator configuration management in devnet-sdk/testing/testlib/validators/forks.go
  3. Testing Infrastructure Improvements:

    • Added new validators for fork configurations and system validation
    • Enhanced wallet management with separate L1 and L2 wallet handling
    • Improved genesis file handling and chain configuration management
  4. Documentation Updates:

    • Added detailed flowcharts in std_output.md for devnet descriptor generation
    • Enhanced documentation for wallet validation and chain configuration
  5. Chain Configuration Updates:

    • Added support for new fork configurations including Isthmus and Jovian
    • Enhanced chain parameter handling with new fields like IsthmusTimeOffset

The changes maintain backward compatibility while adding new testing capabilities that will help ensure the reliability of the Optimism network across different configurations and features.

@teddyknox
Copy link
Contributor Author

/ci authorize 061ab2f

@teddyknox teddyknox marked this pull request as ready for review March 4, 2025 20:32
@teddyknox teddyknox requested review from a team as code owners March 4, 2025 20:32
@teddyknox teddyknox requested a review from ajsutton March 4, 2025 20:32
@teddyknox teddyknox changed the title Add a few new kurtosis-devnet tests Add Isthmus ERC-20 bridge devnet-sdk test Mar 4, 2025
This commit also makes changes to devnet-sdk and kurtosis-devnet
that enable the new tests.
@teddyknox teddyknox force-pushed the devnet-sdk-test-porting-1 branch from 061ab2f to 31f4e0c Compare March 4, 2025 20:57
@codecov
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Project coverage is 45.46%. Comparing base (aa132b3) to head (577c9aa).
Report is 85 commits behind head on develop.

Files with missing lines Patch % Lines
op-service/sources/eth_client.go 0.00% 15 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14631      +/-   ##
===========================================
- Coverage    46.73%   45.46%   -1.27%     
===========================================
  Files         1040      982      -58     
  Lines        89406    84719    -4687     
===========================================
- Hits         41785    38521    -3264     
+ Misses       44533    43285    -1248     
+ Partials      3088     2913     -175     
Flag Coverage Δ
cannon-go-tests-32 ?
cannon-go-tests-64 ?
contracts-bedrock-tests 94.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
op-node/rollup/chain_spec.go 69.64% <ø> (ø)
op-service/sources/eth_client.go 26.05% <0.00%> (-1.59%) ⬇️

... and 65 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@teddyknox teddyknox requested a review from pcw109550 March 5, 2025 03:48
GasPrice(ctx context.Context) (*big.Int, error)
GasLimit(ctx context.Context, tx TransactionData) (uint64, error)
PendingNonceAt(ctx context.Context, address common.Address) (uint64, error)
ChainConfig() (*params.ChainConfig, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

genuine question: should the ChainConfig be an interface i nstead of params.ChainConfig?
same for the Block type below.

I guess I'm a bit worried about the feasibility of providing alternative implementations of these concepts if we leak the concrete types here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally it would be possible to have access to the op-geth chain config in the event that we're testing op-geth specifically, and access to a higher-level interface if we don't care which execution client we're working with. I'd be happy to add the interface for now.

)

func init() {
slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{Level: slog.LevelDebug})))
Copy link
Member

Choose a reason for hiding this comment

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

Need a rebase for removing slog usage. Please refer #14644

Copy link
Member

@pcw109550 pcw109550 left a comment

Choose a reason for hiding this comment

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

Is #14668 intended to separate this PR to smaller chunks? If then, will review after building block PR is merged

clients *clientManager
registry interfaces.ContractsRegistry
mu sync.Mutex
chainConfig *params.ChainConfig
Copy link
Member

Choose a reason for hiding this comment

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

Feels like we need a unification here. #14668 adds descriptors.ChainConfig.

if err != nil {
return fmt.Errorf("failed to add L1 chain: %w", err)
}
fmt.Println("L1 chain ID: ", l1.ID())
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this print should be removed?

func (s *system) addChains(chains ...*descriptors.Chain) error {
for _, chainDesc := range chains {
if chainDesc.ID == "" {
if chainDesc.Name == "Ethereum" {
Copy link
Member

Choose a reason for hiding this comment

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

@teddyknox
Copy link
Contributor Author

Closing in favor of smaller PRs such as #14668

@teddyknox teddyknox closed this Mar 6, 2025
@teddyknox teddyknox added the A-kt-devnet Area: kurtosis devnet label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-kt-devnet Area: kurtosis devnet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments