Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Use MessageIndex in WaitForMessage #10587

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

fridrik01
Copy link
Contributor

@fridrik01 fridrik01 commented Mar 29, 2023

Related Issues

#10583

Proposed Changes

This commit enables the use for MessageIndex in StateWaitForMessage

Test plan

Start lotus node using calibration net

make clean calibnet
lotus daemon --import-snapshot /Users/fridrik/Downloads/calibnet/425760_2023_03_29T14_13_00Z.car --halt-after-import
lotus daemon

Printed out some messages in sqlite/messageindx.db

sqlite3 ~/.lotus/sqlite/msgindex.db
select * from messages order by epoch desc limit 10;
bafy2bzacedqe7fiaxloruetqxf2kfqsorvuhf27llu73vcwolfzfxtotmn2fk|bafy2bzacedioozngzfwlm6qojrqmrbke4evwrsvemeompjttl24gasclvkeqw|425855
bafy2bzacedjhywgkxclwvpbsn7alabrdrhif46bpdvzjyq3yywg7hk3rinfww|bafy2bzacea553srf777sxkkm4vl7fatmsvay3mftw734kxlygem2gsr4jhx2o|425854
bafy2bzacebmbn7syj65duanfehangmj2me6oi2h4fdv6353sg2fs5t5zzyq3g|bafy2bzaced2ztyqrwrew2sxl23plnnjx3nb5st5uhvjsyl3nvdaro2j5ryduc|425853

Picked a message bafy2bzacedjhywgkxclwvpbsn7alabrdrhif46bpdvzjyq3yywg7hk3rinfww and called the RPC endpoint:

> curl -X POST -H "Content-Type: application/json"  --data '{ "jsonrpc": "2.0", "method":"Filecoin.StateWaitMsg", "params": [{"/": "bafy2bzacedjhywgkxclwvpbsn7alabrdrhif46bpdvzjyq3yywg7hk3rinfww"}, 12], "id": 0 }' 'http://127.0.0.1:1234/rpc/v0'
{"jsonrpc":"2.0","result":{"Message":{"/":"bafy2bzacedjhywgkxclwvpbsn7alabrdrhif46bpdvzjyq3yywg7hk3rinfww"},"Receipt":{"ExitCode":0,"Return":null,"GasUsed":1269163,"EventsRoot":null},"ReturnDec":null,"TipSet":[{"/":"bafy2bzacecv3khxqf3kukjzhytqapeuimybi3btgwupvmpnrjrjjzjrxxjehq"},{"/":"bafy2bzacebpgvtikjuy3u7zyupsbqiiqbiljbbwwvajzctlzfsfik4nd7dt4e"},{"/":"bafy2bzacecrcvz3eti6vdvexv6kmbz3hownjwegv7ymc5teac3cidsnm3bmc2"},{"/":"bafy2bzacedij66kwxewue7hrqe3sud4zhh3d44cvvdt6btac6fvuombigwgri"},{"/":"bafy2bzaceddr5jqddtuexe6omesgici55mlji4iztv45euoiiqrkz5xbqdkze"}],"Height":425855},"id":0}

Observed (using debug logs not part of this PR) that we retrieved the message from MessageIndex

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@fridrik01 fridrik01 requested a review from vyzo March 29, 2023 11:37
Copy link
Contributor

@vyzo vyzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, thats so simple!

@fridrik01 fridrik01 marked this pull request as ready for review March 29, 2023 13:12
@fridrik01 fridrik01 requested a review from a team as a code owner March 29, 2023 13:12
@fridrik01 fridrik01 enabled auto-merge March 29, 2023 15:22
@fridrik01 fridrik01 merged commit 36913db into master Mar 29, 2023
@fridrik01 fridrik01 deleted the 10583-enable-index-for-statewaitformessage branch March 29, 2023 16:38
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants