Error: retrieving block: server returned non-empty transaction list but block header indicates no transactions
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x79aeb2]
goroutine 1 [running]:
github.com/ethereum/go-ethereum/core/types.(*Block).Transactions(...)
/home/effsy/go/src/github.com/ethereum/go-ethereum/core/types/block.go:276
github.com/clearmatics/ion/ion-cli/utils.GenerateProof(0x911d20, 0xc4200a0010, 0xc4200f2380, 0xd18e7b108ae79795, 0xa79b85809faaffda, 0x1ce7fd2666e5164d, 0x336d49fec8dcb852, 0x1, 0xc42033e000, 0xc42023db30, ...)
/home/effsy/go/src/github.com/clearmatics/ion/ion-cli/utils/proof.go:33 +0x282
github.com/clearmatics/ion/ion-cli/cli.getProof(0xc420181540, 0xc42002cc30, 0x42)
/home/effsy/go/src/github.com/clearmatics/ion/ion-cli/cli/rpc.go:108 +0xb4
github.com/clearmatics/ion/ion-cli/cli.Launch.func14(0xc42033e000)
/home/effsy/go/src/github.com/clearmatics/ion/ion-cli/cli/cli.go:614 +0x62
github.com/abiosoft/ishell.(*Shell).handleCommand(0xc4201420f0, 0xc42000c180, 0x2, 0x2, 0xc42023dc78, 0xc42023dc80, 0x20)
/home/effsy/go/src/github.com/abiosoft/ishell/ishell.go:278 +0x2cc
github.com/abiosoft/ishell.handleInput(0xc4201420f0, 0xc42000c180, 0x2, 0x2, 0xc42020a400, 0xc420286060)
/home/effsy/go/src/github.com/abiosoft/ishell/ishell.go:232 +0x4d
github.com/abiosoft/ishell.(*Shell).run(0xc4201420f0)
/home/effsy/go/src/github.com/abiosoft/ishell/ishell.go:211 +0x228
github.com/abiosoft/ishell.(*Shell).Run(0xc4201420f0)
/home/effsy/go/src/github.com/abiosoft/ishell/ishell.go:111 +0x39
github.com/clearmatics/ion/ion-cli/cli.Launch()
/home/effsy/go/src/github.com/clearmatics/ion/ion-cli/cli/cli.go:718 +0x1293
main.main()
/home/effsy/go/src/github.com/clearmatics/ion/ion-cli/main.go:13 +0x25
npm install
followed by npm run testrpc
. Note you will need to kill the other instance of ganache-cli
first.
@Shirikatsu Hi, I get an error when I invoke SubmitBlock. After invoking SubmitBlock method, and checking the transaction receipt, the status is "0x0". which means some error in this transaction.
parameters for SubmitBlock are:
_chainId: chainB id(the same as the RegisterChain parameter _chainId)
_rlpUnsignedBlockHeader: ion_cli get UnsignedBlockHeader
_rlpSignedBlockHeader: ion_cli get SignedBlockHeader
_storageAddr: storage contract address by deploy EthereumStore.sol
UnsignedBlockHeader is: f9021aa013fe15da35b4bc5851e4d7b475fbb2b10b8d8ab3e7a8accda80441204c53364ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a01d2ca9d1c74019628bf4ad0d3433fe4dc2f14e14cd69564c4199e36a9ade8738a044a8280c9ccaacf600861694803b08f21907e838b42b3aab5d7ebb7b05cbd2aaa0a5fd92b082d95adc7f20f3958848bc41b6fd1c2620dce23d903119392d67aff1b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000080000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000260874637ed0c01b1c18257bd845d42fbe6a0d883010814846765746888676f312e31302e34856c696e757800000000000000a00000000000000000000000000000000000000000000000000000000000000000880000000000000000
SignedBlockHeader is:
f9025ca013fe15da35b4bc5851e4d7b475fbb2b10b8d8ab3e7a8accda80441204c53364ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a01d2ca9d1c74019628bf4ad0d3433fe4dc2f14e14cd69564c4199e36a9ade8738a044a8280c9ccaacf600861694803b08f21907e838b42b3aab5d7ebb7b05cbd2aaa0a5fd92b082d95adc7f20f3958848bc41b6fd1c2620dce23d903119392d67aff1b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000080000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000260874637ed0c01b1c18257bd845d42fbe6b861d883010814846765746888676f312e31302e34856c696e75780000000000000049789c5898f556b6496ecccb92a8cd49518117d31a11ce4e5d102ed6959814090f72d312b76d6eb11f62489de7505ecaa7a794a77cb5de6c2752764f2910d99a01a00000000000000000000000000000000000000000000000000000000000000000880000000000000000
Can you help check what I do is wrong? Thanks!
connectToClient http://127.0.0.1:8545
addAccount me /home/ubuntu/data0/keystore/UTC--2019-07-26T05-47-16.454289425Z--4a971347a403961837978090998a97e4bd4c63e4
addContractInstance Trigger /home/ubuntu/Go/src/github.com/clearmatics/ion/contracts/functional/Trigger.sol
deployContract Trigger me 1000000
==> deploy contrct address: 0x9Cbf0E03E44Bb2C670AbfD38cCBb47169362dB15
transactionMessage Trigger fire me 0x9Cbf0E03E44Bb2C670AbfD38cCBb47169362dB15 0 1000000
==> transaction hash: 0xcb50d1c2c49883eeac174b17cd5e2cc713b4f21836fecea02b0bd39cc03da8a6
==> block number: 513
==> block hash:0x61b141b2b3cea3660b04ddf5073001238e72d0650cad917428643ac5c9f7a8a1
getBlockByNumber_Clique http://127.0.0.1:8545 513
==>
Signed Block:
f9025ea061b141b2b3cea3660b04ddf5073001238e72d0650cad917428643ac5c9f7a8a1a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0e612e3ec95d235d35f4265c939f2a3fc42de4e96745c261cd1455ad03c94e004a0906c79301ba3a38c534ac66fdade97388171aa8c85a688b005d78ae6f39dbee2a08cd11238516edba8a0ea40bd10bce64742113a4a715d3b6d1d4119617ca5f94fb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000800000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000080008000000000000282020187697e0f3bf13b658257bd845d440a6ab861d883010814846765746888676f312e31302e34856c696e757800000000000000a042445ae83b5d6d22deb53de690cf256b07b2c7efb5f50875465f744e8ae6f041564c96333123a4fefa308cda05e4aaaafb5066401c65ba6dbc247a7fdb179b00a00000000000000000000000000000000000000000000000000000000000000000880000000000000000
Unsigned Block:
f9021ca061b141b2b3cea3660b04ddf5073001238e72d0650cad917428643ac5c9f7a8a1a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0e612e3ec95d235d35f4265c939f2a3fc42de4e96745c261cd1455ad03c94e004a0906c79301ba3a38c534ac66fdade97388171aa8c85a688b005d78ae6f39dbee2a08cd11238516edba8a0ea40bd10bce64742113a4a715d3b6d1d4119617ca5f94fb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000800000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000080008000000000000282020187697e0f3bf13b658257bd845d440a6aa0d883010814846765746888676f312e31302e34856c696e757800000000000000a00000000000000000000000000000000000000000000000000000000000000000880000000000000000
connectToClient http://127.0.0.1:8545
addAccount me /home/ubuntu/data0/keystore/UTC--2019-07-26T05-47-16.454289425Z--4a971347a403961837978090998a97e4bd4c63e4
addContractInstance ion /home/ubuntu/Go/src/github.com/clearmatics/ion/contracts/Ion.sol
deployContract ion me 1000000
ChianA id: 0xaf32c716536cdc65de1f95a7987347b37705559d13c665bf292631a6db394f6d
==> Ion contract address: 0x2b7Bf752Ba104aBf02f1e49948c70Be6713faBDB
addContractInstance ethstore /home/ubuntu/Go/src/github.com/clearmatics/ion/contracts/storage/EthereumStore.sol
deployContract ethstore me 100000000
Ion contract address
deployContract ethstore me 100000000
Ion contract address: 0x2b7Bf752Ba104aBf02f1e49948c70Be6713faBDB
==> ethstore contract address: 0xd93c9Ffddf60bE7ccef688dd913211894dBbcd25
addContractInstance clique /home/ubuntu/Go/src/github.com/clearmatics/ion/contracts/validation/Clique.sol
deployContract clique me 7581563
Ion contract address: 0x2b7Bf752Ba104aBf02f1e49948c70Be6713faBDB
==> clique contract address: 0xC9A36533ef62b9F1a9daAA2e1A0eB5E028140Fe2
transactionMessage clique register me 0xC9A36533ef62b9F1a9daAA2e1A0eB5E028140Fe2 0 7581563
==> transaction hash: 0x7969a7584d74af12a871911b26c65a3e4403bf3a5e2a06aaa0e61e9903fdc323
transactionMessage clique RegisterChain me 0xC9A36533ef62b9F1a9daAA2e1A0eB5E028140Fe2 0 7581563
ChainB id: 0x2eb66993ca9529fde635eef4fcc251573a604f0fc84f25db5c7e139a3d192bde
_validators address: 0xC9A36533ef62b9F1a9daAA2e1A0eB5E028140Fe2
ChainB _genesisBlockHash: 0x61b141b2b3cea3660b04ddf5073001238e72d0650cad917428643ac5c9f7a8a1
_storeAddr: 0xd93c9Ffddf60bE7ccef688dd913211894dBbcd25
==> transaction hash: 0x2c9c598d2ec54a43e718e3209c087ac9a98a40a6ff6378df47f46313f000bbcb
connectToClient http://127.0.0.1:8545
addAccount me /home/ubuntu/data0/keystore/UTC--2019-07-26T05-47-16.454289425Z--4a971347a403961837978090998a97e4bd4c63e4
addContractInstance clique /home/ubuntu/Go/src/github.com/clearmatics/ion/contracts/validation/Clique.sol
transactionMessage clique SubmitBlock me 0xC9A36533ef62b9F1a9daAA2e1A0eB5E028140Fe2 0 7581563
ChainB id: 0x2eb66993ca9529fde635eef4fcc251573a604f0fc84f25db5c7e139a3d192bde
_rlpUnSingedBlockHeader: 0xf9021ca061b141b2b3cea3660b04ddf5073001238e72d0650cad917428643ac5c9f7a8a1a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0e612e3ec95d235d35f4265c939f2a3fc42de4e96745c261cd1455ad03c94e004a0906c79301ba3a38c534ac66fdade97388171aa8c85a688b005d78ae6f39dbee2a08cd11238516edba8a0ea40bd10bce64742113a4a715d3b6d1d4119617ca5f94fb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000800000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000080008000000000000282020187697e0f3bf13b658257bd845d440a6aa0d883010814846765746888676f312e31302e34856c696e757800000000000000a00000000000000000000000000000000000000000000000000000000000000000880000000000000000
_rlpSignedBlockHeader: 0 0xf9025ea061b141b2b3cea3660b04ddf5073001238e72d0650cad917428643ac5c9f7a8a1a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0e612e3ec95d235d35f4265c939f2a3fc42de4e96745c261cd1455ad03c94e004a0906c79301ba3a38c534ac66fdade97388171aa8c85a688b005d78ae6f39dbee2a08cd11238516edba8a0ea40bd10bce64742113a4a715d3b6d1d4119617ca5f94fb90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000800000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000080008000000000000282020187697e0f3bf13b658257bd845d440a6ab861d883010814846765746888676f312e31302e34856c696e757800000000000000a042445ae83b5d6d22deb53de690cf256b07b2c7efb5f50875465f744e8ae6f041564c96333123a4fefa308cda05e4aaaafb5066401c65ba6dbc247a7fdb179b00a000000000000000000000000000000000000
require( checkSignature(_chainId, signedHeader[12].toBytes(), _rlpUnsignedBlockHeader, parentBlockHash), "Signer is not validator" );
in SubmitBlock method. In the checkSignature method, extraDataSig is 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000. I donot know why extraDataSig is abnormal.
So your steps are slightly jumbled here. Registering a chain requires you to provide a genesis block. What this does is then gives you a base from which you will start submitting consequent blocks by referencing the previous one. This is how the submission of blocks works to ensure that you are submitting something correct (by checking against the previous known block for validator sets and the valid signature(s) against the block being submitted).
In this case you've registered the chain by using block 513 as the genesis but also attempting to submit the same block 513. If you submit block 513 as your genesis, you will need to submit block 514 onwards. Thus in your case, if you want to use block 513 (which contains your transaction with the transaction you want to prove and use for interoperation) you must register block 512 as your genesis with RegisterChain
, then submit block 513 with SubmitBlock
.