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

ChainGetTipSetByHeight method synchronization lacks message #4438

Closed
yuzhongrong opened this issue Oct 16, 2020 · 47 comments
Closed

ChainGetTipSetByHeight method synchronization lacks message #4438

yuzhongrong opened this issue Oct 16, 2020 · 47 comments

Comments

@yuzhongrong
Copy link

image

The ChainGetTipSetByHeight method cannot synchronize the messages under all miners and there are references
bug i used the ChainGetTipSetByHeight rpc
Can't sync to that transaction

the method is follow img:
image

@yuzhongrong
Copy link
Author

my transation in blockid is :bafy2bzacecjsjcw5qkptuy4ams62zefuw4cgkbsahnpuqofwwop7cw7e6zwwu

The third from last on page 10 in https://filfox.info/

@yuzhongrong
Copy link
Author

image

5 missing

Uploading image.png…

@crossle
Copy link

crossle commented Oct 16, 2020

You should use the block cid get the message

@yuzhongrong
Copy link
Author

use the block cid get the message?

@yuzhongrong
Copy link
Author

First use the height to get the block cid and then use the blck cid to get the messages?

@crossle
Copy link

crossle commented Oct 16, 2020

First use the height to get the block cid and then use the blck cid to get the messages?

Yes

@yuzhongrong
Copy link
Author

to get all message? in that block

@yuzhongrong
Copy link
Author

ok i try thanks

@yuzhongrong
Copy link
Author

Get which rpc method used by blockcid

@yuzhongrong
Copy link
Author

@yuzhongrong
Copy link
Author

image
this is the method

@yuzhongrong
Copy link
Author

My usage is correct

@yuzhongrong
Copy link
Author

I first get the miner cid on the block and then get the cids under each miner

@crossle
Copy link

crossle commented Oct 16, 2020

image
this is the method

YES

@yuzhongrong
Copy link
Author

no
The total number of messages obtained by this method is incomplete

@yuzhongrong
Copy link
Author

image

Correct is 197 but i get the count is 192 by ChainGetBlockMessages

@yuzhongrong
Copy link
Author

image
image

@yuzhongrong
Copy link
Author

This rpc method is too slow to get data

@yuzhongrong
Copy link
Author

image

@yuzhongrong
Copy link
Author

why?

@yuzhongrong
Copy link
Author

My transaction cid is bafy2bzacebv7h5xsceyz6aqa4robpcjitdmldzkwydklmqzdvhw76d5zikono. Blockchain can be found, but rpc can’t.

@yuzhongrong
Copy link
Author

come on

@crossle
Copy link

crossle commented Oct 16, 2020

My transaction cid is bafy2bzacebv7h5xsceyz6aqa4robpcjitdmldzkwydklmqzdvhw76d5zikono. Blockchain can be found, but rpc can’t.

You mean ChainGetBlockMessages not return your transaction? bafy2bzacebv7h5xsceyz6aqa4robpcjitdmldzkwydklmqzdvhw76d5zikono

@yuzhongrong
Copy link
Author

yes

@yuzhongrong
Copy link
Author

yes yes

@yuzhongrong
Copy link
Author

This transaction can be checked on the browser but rpc cannot be returned

@crossle
Copy link

crossle commented Oct 16, 2020

No, the transaction can be return, i got it. you can send some code snippet to here

@yuzhongrong
Copy link
Author

// 根据高度遍历区块所有交易
func TestClient_ChainGetTipSetByHeight(t *testing.T) {
c := testClient()
ts, err := c.ChainGetTipSetByHeight(context.Background(), 148936, nil)
if err != nil {
t.Error(err)
}
for _, n := range ts.Cids {
t.Log(n)
bm, err := c.ChainGetBlockMessages(context.Background(), n)
if err != nil {
t.Error(err)
}
len:=len(bm.BlsMessages)
t.Log(len)

	for index, _ := range bm.BlsMessages {
		t.Log(bm.Cids[index])
	}
}

}

@yuzhongrong
Copy link
Author

i used the method but cannot the cid of bafy2bzacebv7h5xsceyz6aqa4robpcjitdmldzkwydklmqzdvhw76d5zikono

@yuzhongrong
Copy link
Author

image

@crossle
Copy link

crossle commented Oct 16, 2020

BlsMessages

You transaction is not BlsMessages, it's SecpkMessage

@yuzhongrong
Copy link
Author

thi is go language need to

import (
"context"
"github.com/ipfs/go-cid"
"testing"
)

@yuzhongrong
Copy link
Author

What's the difference?

@yuzhongrong
Copy link
Author

i need to get the SecpkMessages?

@yuzhongrong
Copy link
Author

Uploading image.png…

@crossle
Copy link

crossle commented Oct 16, 2020

i need to get the SecpkMessages?

YES

@yuzhongrong
Copy link
Author

Uploading image.png…

@yuzhongrong
Copy link
Author

image

@yuzhongrong
Copy link
Author

but the cid Incorrect, the cid shoud be follow:

第1个 高度:148,936
mpool_test.go:44: &{0 t1356myoubs6kexyp2hmxujwei6w5c27dggyyekgi t12sn74glfh34c2vbhff7hqwk76yekcqnff6tmtzy 1 1000000000000 539085 151785 150731 0 []}
mpool_test.go:56: 1
mpool_test.go:57: bafy2bzacebv7h5xsceyz6aqa4robpcjitdmldzkwydklmqzdvhw76d5zikono

@yuzhongrong
Copy link
Author

Uploading image.png…

@yuzhongrong
Copy link
Author

image
this transation no cid

@yuzhongrong
Copy link
Author

image

@yuzhongrong
Copy link
Author

you can provide the code to me

@yuzhongrong
Copy link
Author

anyone there

@crossle
Copy link

crossle commented Oct 17, 2020

bm.Cids[index] is the message id, like other blockchain's transaction hash

@zhp1254
Copy link

zhp1254 commented Nov 25, 2020

jsonStr := []byte(fmt.Sprintf({ "jsonrpc": "2.0", "method": "Filecoin.ChainGetBlockMessages", "params": [{"/":"%s"}], "id": 3 }, blockHash))

jsonStr := []byte(fmt.Sprintf({ "jsonrpc": "2.0", "method": "Filecoin.StateReplay", "params": [[{"/":"%s"}],{"/":"%s"}], "id": 3 }, blockHash, cid))

用这两个接口

@EmilyCaoHong
Copy link

ChainGetBlockMessages returns BlsMessages and SecpkMessage, which is tranfer not miner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants