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 Native Token Bridge Tests for c-chain #207

Merged
merged 31 commits into from
Jan 5, 2024
Merged

Conversation

geoff-vball
Copy link
Contributor

@geoff-vball geoff-vball commented Dec 19, 2023

Why this should be merged

Fixes native token bridge contracts and tests for compatibility with c-chain

How this works

Fund the deployerAddress in the native token bridge tests from the funded address.

Add SendNativeTransfer util function.

subnet-evm disallows and transactions being sent to 0x0100000000000000000000000000000000000000 on the c-chain including strict value transfers. This means we need to have a different address to burn tokens with in NativeTokenSource. I chose 0x0100000000000000000000000000000000010203 to fall outside of the reserved range of addresses.

Adds all API endpoints including tracer for the c-chain and subnet configs in our tests.

Added a check to the log for publish block hash.

How this was tested

E2E tests.

How is this documented

@cam-schultz
Copy link
Contributor

subnet-evm disallows and transactions being sent to 0x0100000000000000000000000000000000000000 on the c-chain including strict value transfers.

Was this a recent change? I'm wondering why we didn't bump into this before.

@cam-schultz cam-schultz mentioned this pull request Dec 19, 2023
3 tasks
cam-schultz
cam-schultz previously approved these changes Dec 20, 2023
Base automatically changed from c-chain-integ-tests to main December 21, 2023 21:45
@cam-schultz cam-schultz dismissed their stale review December 21, 2023 21:45

The base branch was changed.

geoff-vball and others added 2 commits January 4, 2024 09:56
Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com>
Signed-off-by: Geoff Stuart <geoff.vball@gmail.com>
Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com>
Signed-off-by: Geoff Stuart <geoff.vball@gmail.com>
michaelkaplan13
michaelkaplan13 previously approved these changes Jan 4, 2024
michaelkaplan13
michaelkaplan13 previously approved these changes Jan 4, 2024
michaelkaplan13
michaelkaplan13 previously approved these changes Jan 4, 2024
address public constant BURNED_TX_FEES_ADDRESS = 0x0100000000000000000000000000000000000000;
// Designated Blackhole Address for this contract. Tokens are sent here to be "burned" when
// a SourceAction.Burn message is received from the destination chain.
address public constant BURN_ADDRESS = 0x0100000000000000000000000000000000010203;

Choose a reason for hiding this comment

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

how is this new burn address chosen? If it's not by random can you add in 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.

It's just arbitrary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addresses of the form 0x010000000000000000000000000000000000XXXX are reserved for precompiles.

fundedKeyStr = "56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027"
warpEnabledChainConfig = `{
"warp-api-enabled": true,
"eth-apis":["eth","eth-filter","net","admin","web3",

Choose a reason for hiding this comment

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

what is the eth-apis config field used for, is it required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They're different collections of API endpoints that the node can chose to run or not. There's a default set, and then some more advanced ones that not everyone might want to expose. TraceTransaction uses one of the non-default APIs, and I've just enabled all the APIs I could find here to make it easier to use others in the future.

cam-schultz
cam-schultz previously approved these changes Jan 4, 2024
michaelkaplan13
michaelkaplan13 previously approved these changes Jan 5, 2024
@geoff-vball geoff-vball merged commit 427bb54 into main Jan 5, 2024
15 checks passed
@geoff-vball geoff-vball deleted the gstuart/fix-ntb-tests branch January 5, 2024 19:02
minghinmatthewlam pushed a commit that referenced this pull request Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants