tomusdrw on tumski
dependabot-preview[bot] on cargo
tomusdrw on master
Bump env_logger from 0.6.2 to 0… (compare)
dependabot-preview[bot] on cargo
Bump env_logger from 0.6.2 to 0… (compare)
tomusdrw on cargo
tomusdrw on master
Bump rustc-hex from 1.0.0 to 2.… (compare)
tomusdrw on cargo
tomusdrw on cargo
Update. (compare)
BridgeRecipient
pragma solidity ^0.5.0;
contract Test {
bool public heads;
constructor () public {
heads = true;
}
function acceptMessage(bytes calldata data, address sender) external {
require(sender != address(0));
require(data.length !=0);
heads = false;
}
function get() external view returns (bool) {
return heads;
}
}
I am using remix to call Main.relayMessage("0x54676545", 0x43AB9938388C6aD102d4868053D7762A635941c7)
@joshua-mir I tried to call a function on my side chain and my bridge crashed with the following message.
Bridge: polling side to main sign failed
Caused by:
RelayStream: relaying logs failed
Caused by:
WithdrawConfirm: message signing failed
Caused by:
Request timed out
Now I get this message whenever i try to restart my bridge.
I deployed the bridge.sol contract manually on both my side chain and main chain using metamask.
The contract code for the caller contract is:
pragma solidity ^0.5.0;
import './bridge.sol';
contract TestMain {
string testData = "cp event fired";
bytes funccallsidedata = '022519df000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000082272616d65657a22000000000000000000000000000000000000000000000000l';
string setData;
event CP_EVENT(string);
Main instance = Main(0x75Ca77F0F69dC7fdfA1c974E73dEBe821C55FB32);
address TestSideAddress = 0x407d3449819A6e47ce43687d58B3C00dCed77bc8;
function Existing(address _t) public {
instance = Main(_t);
}
function triggerEventOnSide() public {
instance.relayMessage(funccallsidedata, TestSideAddress);
emit CP_EVENT(testData);
}
function funcCallOnSide() public {
bytes memory funccallsidedata2 = '022519df000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000082272616d65657a22000000000000000000000000000000000000000000000000l';
instance.relayMessage(funccallsidedata, TestSideAddress);
emit CP_EVENT(testData);
}
function funcCallWithOutPutOnSide() public pure returns (uint){
return 26;
}
function testLogik() public {
}
and the side contract which i am sending the call to:
pragma solidity ^0.5.0;
import './bridge.sol';
contract TestSide is BridgeRecipient {
string testData = "cp event fired";
string setData;
event CP_EVENT(string);
event extFuncCallStatus(bool);
function triggerEvent() public {
emit CP_EVENT(testData);
}
function funcCall(string memory data) public {
setData = data;
emit CP_EVENT(data);
}
function funcCallWithOutPut() public pure returns (uint){
return 26;
}
function acceptMessage(bytes calldata data, address sender) external {
// get and fire function call
bool status;
bytes memory data;
(status , data) = address(this).call(data);
emit extFuncCallStatus(status);
}
}
I called the funcCallOnSide()
which caused the crash.
@joshua-mir the transaction gets mined on the main chain, I have the same authority on both chains as you suggested earlier and the both nodes have access to authority passwords using the .pwds file , I am not sure what I am missing.
here is my node setup
# This config should be placed in following path:
# %AppData%\Parity\Ethereum\config.toml
[parity]
chain = "c:/parity/PoA1.json"
# determines the directory that a Parity instance uses for data and keys
base_path = "c:/tmp/PoA1"
[network]
port = 30301
[rpc]
port = 8541
cors = ["chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn"]
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
[websockets]
port = 8451
[account]
password = ["C:/parity/chain1pwds.pwds"]
[mining]
engine_signer = "0x00Aa39d30F0D20FF03a22cCfc30B7EfbFca597C2"
reseal_on_txs = "none"
min_gas_price = 0x0
here is Node2 Setup:
[parity]
chain = "c:/parity/PoA2.json"
# determines the directory that a Parity instance uses for data and keys
base_path = "c:/tmp/PoA2"
[network]
port = 30302
[rpc]
port = 8542
cors = ["chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn"]
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
[websockets]
port = 8452
[account]
password = ["C:/parity/chain2pwds.pwds"]
[mining]
engine_signer = "0x00Aa39d30F0D20FF03a22cCfc30B7EfbFca597C2"
reseal_on_txs = "none"
min_gas_price = 0x0
INFO 2019-07-30T15:22:48Z: bridge::log_stream: LogStream: fetched confirmed block number 10
INFO 2019-07-30T15:22:48Z: bridge::log_stream: LogStream: fetching logs in blocks 2 to 10
INFO 2019-07-30T15:22:48Z: bridge::log_stream: LogStream (topic: [0x3626c9e69e592ca494da4d6abe2abe54bd68d0c04e51d88d26c2c24d212203a1]): fetched 0 logs from block 2 to block 10
INFO 2019-07-30T15:22:48Z: bridge::log_stream: LogStream (topic: [0x3626c9e69e592ca494da4d6abe2abe54bd68d0c04e51d88d26c2c24d212203a1]): fetched 1 logs from block 2 to block 35
INFO 2019-07-30T15:22:48Z: bridge::accept_message_from_main: 0xe06c7c5f85b0811b0df0c5a06251b52b1c55e6209321c4fd970a36ed0bd31165 - step 1/4 - fetch message using message_id
INFO 2019-07-30T15:22:48Z: bridge::log_stream: LogStream (topic: [0x91e3d056fd990b3d93f81c39b9446a584d01db4e9e6660bf3ac5fc081e151b0f]): fetched 0 logs from block 2 to block 10
INFO 2019-07-30T15:22:48Z: bridge::accept_message_from_main: 0xe06c7c5f85b0811b0df0c5a06251b52b1c55e6209321c4fd970a36ed0bd31165 - 2/4 - checking if the message is already signed
INFO 2019-07-30T15:22:48Z: bridge::accept_message_from_main: 0xe06c7c5f85b0811b0df0c5a06251b52b1c55e6209321c4fd970a36ed0bd31165 - 3/4 - accepting the message
INFO 2019-07-30T15:22:49Z: bridge::block_number_stream: BlockNumberStream polling last block number
INFO 2019-07-30T15:22:49Z: bridge::block_number_stream: BlockNumberStream polling last block number
INFO 2019-07-30T15:22:49Z: bridge::block_number_stream: BlockNumberStream polling last block number
INFO 2019-07-30T15:22:49Z: bridge::block_number_stream: BlockNumberStream: fetched last block number 10
INFO 2019-07-30T15:22:49Z: bridge::block_number_stream: BlockNumberStream: no blocks confirmed since we last checked. waiting some more
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream polling last block number
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream polling last block number
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream polling last block number
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream: fetched last block number 10
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream: no blocks confirmed since we last checked. waiting some more
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream: fetched last block number 10
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream: no blocks confirmed since we last checked. waiting some more
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream: fetched last block number 35
INFO 2019-07-30T15:22:52Z: bridge::block_number_stream: BlockNumberStream: no blocks confirmed since we last checked. waiting some more
INFO 2019-07-30T15:22:53Z: bridge::block_number_stream: BlockNumberStream polling last block number
Bridge: polling main to side sign failed
Caused by:
RelayStream: relaying logs failed
Caused by:
AcceptMessageFromMain: checking whether 0xe06c…1165 was relayed failed
Caused by:
env RUST_LOG=info parity-bridge-deploy --config bridge_config.toml --database bridge.db
INFO 2019-08-02T16:07:03Z: parity_bridge_deploy: Parsing cli arguments
INFO 2019-08-02T16:07:03Z: parity_bridge_deploy: Loading config
INFO 2019-08-02T16:07:03Z: parity_bridge_deploy: Starting event loop
INFO 2019-08-02T16:07:03Z: parity_bridge_deploy: Establishing HTTP connection to main "http://localhost:8547"
INFO 2019-08-02T16:07:03Z: parity_bridge_deploy: Establishing HTTP connection to side "http://localhost:8546"
INFO 2019-08-02T16:07:03Z: parity_bridge_deploy: Deploying MainBridge contract
INFO 2019-08-02T16:07:03Z: bridge::deploy: sending MainBridge contract deployment transaction and waiting for 0 confirmations...
DeployMain: deployment transaction failed
Caused by:
SendTransactionWithReceipt: fetching last block number failed
Caused by:
Error(InvalidResponse("Error(\"expected value\", line: 1, column: 1)"), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })