Docker deployment invalid Signature

Nice!
something happened and it looks like we are so close!?
Node1 Logs
Node3 Logs

These two nodes have debugging on.
Looks like they are failing at making proposals…

Your time is appreciated,
Z

@zaxaz Did you start all nodes, starting with the first and finishing with the last one?

Yesir.
The order of operations was as you described.

@zaxaz It looks like a step further. At least now it tries to build blocks. It seems like there is a problem with the peers connecting with each other. Usually, when you start a node, you should see something like Peer connected: id=16Uiu2HAmCYkt1ccWshwBabTAhHnk8DeehWEd3T9Hx4rWCQmcXVWL, which shows that other peers connected.

Please check if everything is okay with your ports, so the peers are able to connect.

Understood.
Good to know.
I will test and report.

@zaxaz Hi, just checking to see how’s it going

I gave up on docker.
I attempted the much more expensive terraform deployment which failed.
The S3 bucket was created, but the genesis.json was never put in there.
Spent a little bit of time trying to figure out which instance the genesis command was on but no luck.
Any suggestions?
Thanks

@zaxaz Did you checkout our Terraform AWS Deployment guide: Terraform AWS Deployment | Polygon Technology | Documentation?

Certainly.
What I think happened, which there seems to be mixed messaging about, is the premine attribute.
The example on the docs you posted say
premine = “0xaddress”
The Terraform Readme says it must comply with CLI premine which is premine = “account:amoun”
I mostly followed

I used premine: account:amount

It all deployed, only the nodes did not get a genesis block because the script failed and did not put a genesis block in S3, but I dont know where to look to find out why it failed.

Hi @zaxaz ,

Sorry for the late reply. I will give you an example on how to use the --premine flag. Let’s say we want to premine this public address: 0x74646E404C093fF31b475737Ea4113FFeA19Fe80. We have a default premine ammount, which is 1 million units of native currency. If you want to specify a certain amount, you can use this genesis --premine ADDRESS:VALUE.

Example with default amount: --premine 0x74646E404C093fF31b475737Ea4113FFeA19Fe80
Example with custom amount: --premine 0x74646E404C093fF31b475737Ea4113FFeA19Fe80:1000000000000000000000

How did you use the command?

ADDRESS:VALUE

I was doing some digging into my docker deployment again.
Can you explain how the nodes know how to talk to eachother?
Do boot nodes provide information about the other nodes?
Where do they get IP and Port information about eachother…
I noticed i was using alot of 127.0.0.1, but then each node calls to localhost and nothing about other nodes is in localhost.

For my boot nodes, I do not know their docker IP, before hand, should I set them, I know I can, just trying to figure out the chicken before the egg thing…

I feel like I am very close.
Your patience and expertise is appreciated,
Z

@zaxaz The nodes communicate with each other via bootnodes. If you are using localhost, then the ip is indeed 127.0.0.1. You choose what port you want for your bootnode. It should be the port to which the libp2p server will listen.

I have the same error, were you able to find how to resolve the error?

My case :

  • All polygon nodes deployed on same instance. Have a premier account with enough tokens
  • Using Forge to create a smart contract on the network using the premier account private key.
  • Premier account created using metamask and private key imported from there.
  • a difference i see is that the my error is from eth_estimateGas() fn while for Z its from eth_call()
  • a similarity with Z is, we both have http endpoints. Do you guys think ssl matter?

My contracts are successful when using a chainstack polygon node though.

Here are the commands and logs.

forge create HelloWorld --contracts $CONTRACT_PATH --rpc-url=$EC2_ENDPOINT --private-key=$METAMASK_PRIVATE_KEY  --constructor-args "Hello" --legacy

[⠢] Compiling...
No files changed, compilation skipped
Error: 
(code: -32600, message: unable to apply transaction even for the highest gas limit 5242880: invalid signature, data: None)

Node Log :

2022-11-29T21:08:42.827Z [INFO]  polygon.server.ibft.consensus: round timeout expired: round=3
2022-11-29T21:08:42.828Z [INFO]  polygon.server.ibft.consensus: round started: round=4
2022-11-29T21:08:42.828Z [INFO]  polygon.server.ibft.consensus: we are the proposer
2022-11-29T21:09:12.842Z [ERROR] polygon.server.dispatcher: failed to dispatch: method=eth_estimateGas err="unable to apply transaction even for the highest gas limit 5242880: invalid signature"
2022-11-29T21:11:24.829Z [ERROR] polygon.server.ibft.consensus: unable to build proposal
2022-11-29T21:11:24.829Z [INFO]  polygon.server.ibft.consensus: round timeout expired: round=4
2022-11-29T21:11:24.830Z [INFO]  polygon.server.ibft.consensus: round started: round=5

Hi,
I have the same error when trying to deploy my contract with Hardhat on a local installation of Polygon Edge.

I deployed four nodes as recommended, they are all connected and my deployment account shows up in Metamask with provisions.

2022-12-01T22:37:33.312Z [ERROR] polygon.server.dispatcher: failed to dispatch: method=eth_estimateGas err="unable to apply transaction even for the highest gas limit 30000000: invalid signature"

In fact I have the same errors when trying to transfer values between accounts in Metamask.

Need to see some of your deployment, boot node configuration. Docker or VMs?

Was able to fix mine by using --ibft-validator-type ecdsa

polygon-edge genesis --consensus ibft --ibft-validator-type ecdsa --ibft-validators-prefix-path test-chain- --bootnode /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAm4QC9ZejDWdb9NTTYrgo53e48xRAfoAJYPvEkUzLPz7Ca --bootnode /ip4/127.0.0.1/tcp/20001/p2p/16Uiu2HAmH7gTpvmLdz4ZXwxTo71m6h4JW5tefKCHAP2T7ewzwKfv --premine 0xB8aA26439cB203eEb13b81582E846F6442d28d17:1000000000000000000000000000 

1 Like

Here is how I proceed:

Initialize data folders for IBFT and generate validator keys

docker run -it --rm -v ~/polygone/data/:/polygone/data/   0xpolygon/polygon-edge   secrets init --data-dir /polygone/data/chain-1
docker run -it --rm -v ~/polygone/data/:/polygone/data/   0xpolygon/polygon-edge   secrets init --data-dir /polygone/data/chain-2
docker run -it --rm -v ~/polygone/data/:/polygone/data/   0xpolygon/polygon-edge   secrets init --data-dir /polygone/data/chain-3
docker run -it --rm -v ~/polygone/data/:/polygone/data/   0xpolygon/polygon-edge   secrets init --data-dir /polygone/data/chain-4

Generate the genesis file with the 4 nodes as validators

Those familiar with hardhat will recognize the accounts I used for the premining:

docker run -it --rm  -v ~/polygone/data/:/polygone/data/ -v ~/polygone/genesis:/polygone/genesis/   0xpolygon/polygon-edge  genesis --dir /polygone/genesis/genesis.son --consensus ibft --ibft-validators-prefix-path /polygone/data/chain- --bootnode /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAmLqXLsTJ4GsFWoJVSgRjmV1sDU7CZuJNXmm8X3at4refk --premine 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266:1000000000000000000000 --premine 0x70997970C51812dc3A010C7d01b50e0d17dc79C8:1000000000000000000000 --premine 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC:1000000000000000000000 --block-gas-limit 30000000 --ibft-validator-type ecdsa

Run all the clients

docker run --network host -it --rm  -v ~/polygone/data/:/polygone/data/  -v ~/polygone/genesis:/polygone/genesis/    0xpolygon/polygon-edge server --data-dir /polygone/data/chain-1 --chain /polygone/genesis/genesis.son --grpc-address :10000 --libp2p :10001 --jsonrpc :10002 --seal

docker run  --network host -it --rm  -v ~/polygone/data/:/polygone/data/  -v ~/polygone/genesis:/polygone/genesis/    0xpolygon/polygon-edge server --data-dir /polygone/data/chain-2 --chain /polygone/genesis/genesis.son --grpc-address :20000 --libp2p :20001 --jsonrpc :20002 --seal

docker run  --network host  -it --rm  -v ~/polygone/data/:/polygone/data/  -v ~/polygone/genesis:/polygone/genesis/    0xpolygon/polygon-edge server --data-dir /polygone/data/chain-3 --chain /polygone/genesis/genesis.son --grpc-address :30000 --libp2p :30001 --jsonrpc :30002 --seal

docker run  --network host -it --rm  -v ~/polygone/data/:/polygone/data/  -v ~/polygone/genesis:/polygone/genesis/    0xpolygon/polygon-edge server --data-dir /polygone/data/chain-4 --chain /polygone/genesis/genesis.son --grpc-address :40000 --libp2p :40001 --jsonrpc :40002 --seal

And so when after that I try to deploy my contract using the private key of one of the premined accounts, I get the error:

2022-12-02T09:57:26.372Z [ERROR] polygon.server.dispatcher: failed to dispatch: method=eth_estimateGas err="unable to apply transaction even for the highest gas limit 30000000: invalid signature"

For creating the genesis file can you include the validation-type to ecdsa ? Use the following command to generate the genesis file.

docker run -it --rm  -v ~/polygone/data/:/polygone/data/ -v ~/polygone/genesis:/polygone/genesis/   0xpolygon/polygon-edge  genesis --dir /polygone/genesis/genesis.son --consensus ibft --ibft-validator-type ecdsa --ibft-validators-prefix-path /polygone/data/chain- --bootnode /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAmLqXLsTJ4GsFWoJVSgRjmV1sDU7CZuJNXmm8X3at4refk --premine 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266:1000000000000000000000 --premine 0x70997970C51812dc3A010C7d01b50e0d17dc79C8:1000000000000000000000 --premine 0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC:1000000000000000000000 --block-gas-limit 30000000 --ibft-validator-type ecdsa
1 Like

My contract deployment is finally working!

Thanks @austinblaise , I added the ecdsa option. It may have been one of the causes of my problem, but it was not the only one.

It turns out that even if I didn’t get an error message when starting the nodes, the client configuration directory was not well specified.

In my previous commands, you can see that I was configuring the client volume as follows:

-v ~/polygone/data/:/polygone/data/ 

And I set it as an option as follows:

--data-dir /polygone/data/chain-1

And in the genesis file generation command, I would set the --ibft-validators-prefix-path option value as follows:

--ibft-validators-prefix-path /polygone/data/chain-

When I started the nodes, there were no error messages, but there were no mining logs, and if I hadn’t properly read the discussion in this topic, I wouldn’t have known that my clients weren’t running properly.

So I changed these options as follows. The volume is now mounted as follows (for node 1):

-v ~/polygon/data/chain-1:/chain-1

The client directory is passed as follows:

--data-dir ./chain-1

And finally in the genesis file generation command, I now set the --ibft-validators-prefix-path option value as follows:

--ibft-validators-prefix-path chain-

If these tools are indeed intended for use by Web3 developers it would be really nice to improve the doc or code to have relevant error messages, it would be beneficial to everyone. Understanding these little details should not have taken me so much effort.

2 Likes