-
Notifications
You must be signed in to change notification settings - Fork 0
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
add avalanche support #1
base: main
Are you sure you want to change the base?
Conversation
6075ba3
to
bfae7d5
Compare
f8a9768
to
bd5d67a
Compare
d8f8e1c
to
7f2ff5a
Compare
…che_tidy Tidy initial avalanche impl
* add waiting bootsrapped state * add avalanche integration and add subnet creation * add implementation for subnet chains * move port binding allocation * deascrease block number for WaitForBlocks * dont send avax if subnets list is empty * revert image pulling
# Conflicts: # configuredChains.yaml # go.mod # go.sum # label/label.go
* add subnets info flag "track-subnets" * fix fn for waiting network * add subnet-evm * add WithAssumeDecided for IssueCreateSubnetTx * add timeout after import * add ignoring errors * fix err * fix subnet-evm genesis * add simple implementation for SendFunds * add validators for subnet * make 1 transaction at now * add waiting delta * stop container print evm tx hash --------- Co-authored-by: ramil <ramilexe@gmail.com>
enable image pulling
chain/avalanche/package.go
Outdated
avaxAddr, _ := address.Format("X", chainId.Name, key.Address().Bytes()) | ||
allocations := []GenesisAllocation{ | ||
{ | ||
ETHAddr: "0x" + key.PublicKey().Address().Hex(), |
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.
This is a bug. These aren't ethereum addresses. Ethereum address are computed by taking the keccak256 checksum of the public key, then truncating to 20 bytes.
If you look at the code for key.PublicKey().Address()
, the address function does two hashing operations. I'm not sure why but the end result is that the address is not an ethereum address.
Later in the code, during CChain genesis (node_genesis.go, NewGenesis
function) the 'ETHAddr' is used in the genesis "alloc" field. So the end result, I think, is that the wrong address is put into the chain Genesis.
For comparison, if you do the following, you will get a different address than what you did here:
privateKey, err := crypto.HexToECDSA("56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027")
if err != nil {
return fmt.Errorf("can't parse private key: %s", err)
}
ethAddr := crypto.PubkeyToAddress(privateKey.PublicKey)
addrHex = ethAddr.Hex()
fmt.Printf("key addr: %s\n", addrHex)
No description provided.