Skip to content

Skip e2e test fee currency unblock #374

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

Open
wants to merge 1 commit into
base: celo-rebase-12
Choose a base branch
from

Conversation

piersy
Copy link

@piersy piersy commented Apr 30, 2025

This test is failing for me when run locally

Environment:

forge --version
forge 0.2.0 (143abd6 2024-09-04T00:24:41.963834000Z)

Log:

./e2e_test/run_all_tests.sh  unblock
Using local network
go run build/ci.go install ./cmd/geth
>>> /nix/store/s9lcj79q6p6bnx4jwlf310ar9vhnf0g5-go-1.23.5/share/go/bin/go build -ldflags "--buildid=none -X github.com/ethereum/go-ethereum/internal/version.gitCommit=c326d0ac6b11a9405fc47963f85549c2d182e556 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20250423 -s" -tags urfave_cli_no_docs,ckzg -trimpath -v -o /Users/pierspowlesland/projects/op-geth/build/bin/geth ./cmd/geth
Done building.
Run "./build/bin/geth" to launch geth.
Geth ready, start tests
Error:
server returned an error response: error code -32000: transaction indexing is in progress, data: "transaction indexing is in progress"
Globbing with "unblock"
for file test_fee_currency_unblock.sh

Run test_fee_currency_unblock.sh
Using local network
+ trap 'kill %%' EXIT
+ tail -F -n0 geth.log
+ sleep 0.2
++ deploy_fee_currency false false true
++ DEFAULT_INTRINSIC_GAS=60000
+++ forge create --json --root /Users/pierspowlesland/projects/op-geth/e2e_test/debug-fee-currency --contracts /Users/pierspowlesland/projects/op-geth/e2e_test/debug-fee-currency --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 DebugFeeCurrency.sol:DebugFeeCurrency --constructor-args 100000000000000000000000000 false false true
+++ jq .deployedTo -r
++ local fee_currency=0x585809932b336Cc0F8F7bc6f157801d4266A7483
++ '[' -z 0x585809932b336Cc0F8F7bc6f157801d4266A7483 ']'
++ cast send --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0003 'setExchangeRate(address, uint256, uint256)' 0x585809932b336Cc0F8F7bc6f157801d4266A7483 2ether 1ether
++ cast send --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x15F344b9E6c3Cb6F0376A36A64928b13F62C6276 'setCurrencyConfig(address, address, uint256)' 0x585809932b336Cc0F8F7bc6f157801d4266A7483 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0003 60000
++ echo 0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ fee_currency=0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ cip_64_tx 0x585809932b336Cc0F8F7bc6f157801d4266A7483 1 true 2
+ assert_cip_64_tx false
+ local value
+ read -r value
++ cast chain-id
+ /Users/pierspowlesland/projects/op-geth/e2e_test/js-tests/send_tx.mjs 1337 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x585809932b336Cc0F8F7bc6f157801d4266A7483 1 true 2
+ local expected_error=
++ echo '{"success":false,"replaced":false,"error":null}'
++ jq .success
+ '[' false '!=' false ']'
+ '[' -z '' ']'
+ expected_error=null
+ echo '{"success":false,"replaced":false,"error":null}'
+ jq .error
+ grep -qE null
+ sleep 2
+ unblock_fee_currency 0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ cast rpc admin_unblockFeeCurrency 0x585809932b336Cc0F8F7bc6f157801d4266A7483
true
+ cip_64_tx 0x585809932b336Cc0F8F7bc6f157801d4266A7483 1 true 2
+ assert_cip_64_tx false
+ local value
+ read -r value
++ cast chain-id
+ /Users/pierspowlesland/projects/op-geth/e2e_test/js-tests/send_tx.mjs 1337 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x585809932b336Cc0F8F7bc6f157801d4266A7483 1 true 2
+ local expected_error=
++ echo '{"success":false,"replaced":false,"error":null}'
++ jq .success
+ '[' false '!=' false ']'
+ '[' -z '' ']'
+ expected_error=null
+ echo '{"success":false,"replaced":false,"error":null}'
+ jq .error
+ grep -qE null
+ cleanup_fee_currency 0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ local fee_currency=0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ cast send --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x15F344b9E6c3Cb6F0376A36A64928b13F62C6276 'removeCurrencies(address, uint256)' 0x585809932b336Cc0F8F7bc6f157801d4266A7483 2 --json
+ jq 'if .status == "0x1" then 0 else 1 end' -r
0
+ sleep 0.5
++ grep -Ec 'fee-currency EVM execution error.+fee-currency contract error during internal EVM call: surpassed maximum allowed intrinsic gas for CreditFees\(\) in fee-currency' debug-fee-currency/geth.unblock_fee_currency.log
+ '[' 1 -ne 2 ']'
+ exit 1
+ kill %%
FAIL test_fee_currency_unblock.sh ❌

1/1 failed.

@piersy piersy requested a review from Kourin1996 April 30, 2025 15:43
Copy link

@Kourin1996 Kourin1996 left a comment

Choose a reason for hiding this comment

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

LGTM but the test didn't fail in my local environment.
Can you write the log and forge version here as references?

@piersy
Copy link
Author

piersy commented Apr 30, 2025

Hey @Kourin1996 added the info in the PR description, can you share your forge version and I'll see if using it changes the outcome for me?

@Kourin1996
Copy link

@piersy mine was 1.1.0 but the test passed even though I downgraded to 0.2.0

forge Version: 1.1.0-stable
Commit SHA: d484a00089d789a19e2e43e63bbb3f1500eb2cbf
Build Timestamp: 2025-04-30T13:50:49.971365000Z (1746021049)
Build Profile: maxperf

Here is the log. (I ran the target only)

Using local network
go run build/ci.go install ./cmd/geth
>>> /Users/yoshiki/.asdf/installs/golang/1.22.7/go/bin/go build -ldflags "--buildid=none -X github.com/ethereum/go-ethereum/internal/version.gitCommit=af1c98e74ac0175608a6eb9af90df2108bced0e8 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20250501 -s" -tags urfave_cli_no_docs,ckzg -trimpath -v -o /Users/yoshiki/Projects/celo/op-geth/build/bin/geth ./cmd/geth
Done building.
Run "./build/bin/geth" to launch geth.
Geth ready, start tests
Error: 
server returned an error response: error code -32000: transaction indexing is in progress, data: "transaction indexing is in progress"
Globbing with ""
for file test_base_fee_recipient.sh
for file test_ethers_tx.sh
for file test_fee_currency_disable_and_enable_blocking.sh
for file test_fee_currency_disable_blocking.sh
for file test_fee_currency_fails_intrinsic.sh
for file test_fee_currency_fails_on_credit.sh
for file test_fee_currency_fails_on_debit.sh
for file test_fee_currency_gas_estimation.sh
for file test_fee_currency_unblock.sh

Run test_fee_currency_unblock.sh
Using local network
+ trap 'kill %%' EXIT
+ tail -F -n0 geth.log
+ sleep 0.2
++ deploy_fee_currency false false true
++ DEFAULT_INTRINSIC_GAS=60000
+++ forge create --json --root /Users/yoshiki/Projects/celo/op-geth/e2e_test/debug-fee-currency --contracts /Users/yoshiki/Projects/celo/op-geth/e2e_test/debug-fee-currency --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 DebugFeeCurrency.sol:DebugFeeCurrency --constructor-args 100000000000000000000000000 false false true
+++ jq .deployedTo -r
++ local fee_currency=0x585809932b336Cc0F8F7bc6f157801d4266A7483
++ '[' -z 0x585809932b336Cc0F8F7bc6f157801d4266A7483 ']'
++ cast send --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0003 'setExchangeRate(address, uint256, uint256)' 0x585809932b336Cc0F8F7bc6f157801d4266A7483 2ether 1ether
++ cast send --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x15F344b9E6c3Cb6F0376A36A64928b13F62C6276 'setCurrencyConfig(address, address, uint256)' 0x585809932b336Cc0F8F7bc6f157801d4266A7483 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0003 60000
++ echo 0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ fee_currency=0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ cip_64_tx 0x585809932b336Cc0F8F7bc6f157801d4266A7483 1 true 2
+ assert_cip_64_tx false
+ local value
+ read -r value
++ cast chain-id
+ /Users/yoshiki/Projects/celo/op-geth/e2e_test/js-tests/send_tx.mjs 1337 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x585809932b336Cc0F8F7bc6f157801d4266A7483 1 true 2
+ local expected_error=
++ echo '{"success":false,"replaced":false,"error":null}'
++ jq .success
+ '[' false '!=' false ']'
+ '[' -z '' ']'
+ expected_error=null
+ echo '{"success":false,"replaced":false,"error":null}'
+ jq .error
+ grep -qE null
+ sleep 2
+ unblock_fee_currency 0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ cast rpc admin_unblockFeeCurrency 0x585809932b336Cc0F8F7bc6f157801d4266A7483
true
+ cip_64_tx 0x585809932b336Cc0F8F7bc6f157801d4266A7483 1 true 2
+ assert_cip_64_tx false
+ local value
+ read -r value
++ cast chain-id
+ /Users/yoshiki/Projects/celo/op-geth/e2e_test/js-tests/send_tx.mjs 1337 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x585809932b336Cc0F8F7bc6f157801d4266A7483 1 true 2
+ local expected_error=
++ echo '{"success":false,"replaced":false,"error":null}'
++ jq .success
+ '[' false '!=' false ']'
+ '[' -z '' ']'
+ expected_error=null
+ echo '{"success":false,"replaced":false,"error":null}'
+ jq .error
+ grep -qE null
+ cleanup_fee_currency 0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ local fee_currency=0x585809932b336Cc0F8F7bc6f157801d4266A7483
+ cast send --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x15F344b9E6c3Cb6F0376A36A64928b13F62C6276 'removeCurrencies(address, uint256)' 0x585809932b336Cc0F8F7bc6f157801d4266A7483 2 --json
+ jq 'if .status == "0x1" then 0 else 1 end' -r
0
+ sleep 0.5
++ grep -Ec 'fee-currency EVM execution error.+fee-currency contract error during internal EVM call: surpassed maximum allowed intrinsic gas for CreditFees\(\) in fee-currency' debug-fee-currency/geth.unblock_fee_currency.log
+ '[' 2 -ne 2 ']'
+ kill %%
PASS test_fee_currency_unblock.sh
for file test_smoketest.sh
for file test_token_duality.sh
for file test_value_and_fee_currency_balance_check.sh
for file test_viem_tx.sh

According to your log, unblock seems not to have worked even though admin_unblockFeeCurrency was called because EVM error appeared only once.

@piersy
Copy link
Author

piersy commented Apr 30, 2025

Hmm, using the same forge version as you I get a different error:

./e2e_test/run_all_tests.sh  unblock
Using local network
go run build/ci.go install ./cmd/geth
>>> /nix/store/s9lcj79q6p6bnx4jwlf310ar9vhnf0g5-go-1.23.5/share/go/bin/go build -ldflags "--buildid=none -X github.com/ethereum/go-ethereum/internal/version.gitCommit=c326d0ac6b11a9405fc47963f85549c2d182e556 -X github.com/ethereum/go-ethereum/internal/version.gitDate=20250423 -s" -tags urfave_cli_no_docs,ckzg -trimpath -v -o /Users/pierspowlesland/projects/op-geth/build/bin/geth ./cmd/geth
Done building.
Run "./build/bin/geth" to launch geth.
Geth ready, start tests
Error: server returned an error response: error code -32000: transaction indexing is in progress, data: "transaction indexing is in progress"
Globbing with "unblock"
for file test_fee_currency_unblock.sh

Run test_fee_currency_unblock.sh
Using local network
+ prepare_node
+ cd js-tests
+ [[ -d node_modules ]]
+ trap 'kill %%' EXIT
+ tail -F -n0 geth.log
+ sleep 0.2
++ deploy_fee_currency false false true
++ DEFAULT_INTRINSIC_GAS=60000
+++ forge create --json --root /Users/pierspowlesland/projects/op-geth/e2e_test/debug-fee-currency --contracts /Users/pierspowlesland/projects/op-geth/e2e_test/debug-fee-currency --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 DebugFeeCurrency.sol:DebugFeeCurrency --constructor-args 100000000000000000000000000 false false true
+++ jq .deployedTo -r
++ local fee_currency=null
++ '[' -z null ']'
++ cast send --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0003 'setExchangeRate(address, uint256, uint256)' null 2ether 1ether
Error: parser error:
null
^
expected hex digits or the `0x` prefix for an empty hex string
++ cast send --private-key 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 0x15F344b9E6c3Cb6F0376A36A64928b13F62C6276 'setCurrencyConfig(address, address, uint256)' null 0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0003 60000
Error: parser error:
null
^
expected hex digits or the `0x` prefix for an empty hex string
++ echo null
+ fee_currency=null
+ cip_64_tx null 1 true 2
+ assert_cip_64_tx false
+ local value
+ read -r value
++ cast chain-id
+ /Users/pierspowlesland/projects/op-geth/e2e_test/js-tests/send_tx.mjs 1337 0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 null 1 true 2
+ local expected_error=
++ echo '{"success":false,"replaced":false,"error":{"shortMessage":"`feeCurrency` MUST be a token address for CIP-64 transactions.","version":"2.21.27","name":"BaseError"}}'
++ jq .success
+ '[' false '!=' false ']'
+ '[' -z '' ']'
+ expected_error=null
+ echo '{"success":false,"replaced":false,"error":{"shortMessage":"`feeCurrency` MUST be a token address for CIP-64 transactions.","version":"2.21.27","name":"BaseError"}}'
+ jq .error
+ grep -qE null
+ kill %%
FAIL test_fee_currency_unblock.sh ❌

1/1 failed.

It seems that the forge create command is not outputting a deployedTo field

@Kourin1996
Copy link

Kourin1996 commented Apr 30, 2025

@piersy For latest forge, --broadcast flag is necessary for forge create command in e2e_test/debug-fee-currency/lib.sh like this:

forge create --json --broadcast --root "$SCRIPT_DIR/debug-fee-currency" --contracts "$SCRIPT_DIR/debug-fee-currency" --private-key $ACC_PRIVKEY DebugFeeCurrency.sol:DebugFeeCurrency --constructor-args '100000000000000000000000000' $1 $2 $3 | jq .deployedTo -r

But I don't think the original error caused by the different version of forge

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