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

[3.1] Fix issue with current block not sent to SHiP clients #472

Merged
merged 3 commits into from
Jun 21, 2022

Conversation

heifner
Copy link
Member

@heifner heifner commented Jun 20, 2022

head not updated until after accepted_block signal is emitted. This prevents controller fetch_block_by_number from returning the current block signaled. Work around this issue by using the signaled block_state and get_block_id_for_num method.

Added new SHiP streamer client that will stream blocks from SHiP. It doesn't support ABI currently, so blocks, traces, and deltas are all in hex. Added new python integration test that uses the SHiP streamer to verify blocks are returned from SHiP.

Example output from ship_streamer:

./tests/ship_streamer --start-block-num 253185406 --end-block-num 253185407 --fetch-block --fetch-traces
[
{ "get_blocks_result_v0":
{
    "head": {
        "block_num": 253185721,
        "block_id": "0F174EB908AAB71C735163B7AE4419A6B63F56654A71FBD864F2E55D72086AC7"
    },
    "last_irreversible": {
        "block_num": 253185396,
        "block_id": "0F174D7420F6888F4A8BAD6FA326732CB1A77574E55908AFE2496916B88A787D"
    },
    "this_block": {
        "block_num": 253185406,
        "block_id": "0F174D7E0F5833075061B57999239235417D3C853754F355B6BB62772AFED7B4"
    },
    "prev_block": {
        "block_num": 253185405,
        "block_id": "0F174D7D1724709B1438732ACEDDBFFD587CD5D9D5C54FBE381C174CB2B28A1F"
    },
    "block": "69548754C0F39AD46533315500000F174D7D1724709B1438732ACEDDBFFD587CD5D9D5C54FBE381C174CB2B28A1FF8FB72681103335DF364712A14820065D0F75882C964C9960C72249A6039E7F3E3F25C945F0B10EA35D0838609C79F0AFCE099AAA165CBD6BA43EEF0559FA2B6E4070000000000206775A5E88AAB390140B1A92435888FBED6E8CB4ABE49C55CB6172053834B01D5244A0EE0AE6A0B7B5155D18F8140F75439BC864850186D01E907DFFB0DECCE630100E70000000E0101001F496C2EA44436560EE068E0002EDDA20B861E4D19C3F0774E776EE7D6DDEB9E2E42316A9EFC0D7B6D0A205454B11010D44FE0C46392FFD95A4B180B9C0CB0783F0000422AEEB062704DBD567B080000000001A09899FE4E9CBE6A0000000000A0A6930190548CF4E649914A00000000A8ED3232108C9E0E0000000000C83F0C00000000000000",
    "traces": "020047EAA0C8A28FAFAFCE53E564556C12DC339C61B56C3D7F654951A2D96B39E19000640000000000000000000000000000000000000000000101010001000000000000EA3055F63E01BE75FE97660360E1799236EF32883F819F5FB8338106866DAB7C79F0D7DF1F35EE52000000E71C2C1300000000010000000000EA3055AAA44E0F0000000011120000000000EA30550000000000EA305500000000221ACFA4010000000000EA305500000000A8ED32327468548754C0F39AD46533315500000F174D7C6C17CB5036E53FF1D10E9A3D44D3C54BEA32C64F7DC2AD2876867B433D24A0D35C02BD7F0FDCB5B42B43313D67D52661DDCA11FB65B45CDD24675F0C1C1573A11CF9C8CF1A6DC7EABB557A787E1DE5A12A7ABA782231183F66965003E407000000000000000000000000000000000000000000000100000000000000000000000000000000000018C80BCDA6EBC1CBF7CBC73CAC02CB2A8EAFE3A302C8B5B87D662DB13402787D00E70000000E0000000000000000700000000000000000010101000100A09899FE4E9CBE6AC53B91EA901363289E8CC5D03C97D1BC8086B3DD3C633B2B2A09A4E768C7198EE01F35EE52000000F3243100000000000190548CF4E649914A6DB80300000000005206A09899FE4E9CBE6AA09899FE4E9CBE6A0000000000A0A6930190548CF4E649914A00000000A8ED3232108C9E0E0000000000C83F0C000000000000000000000000000000000000000000000001002AEEB062704DBD567B080000000001001F496C2EA44436560EE068E0002EDDA20B861E4D19C3F0774E776EE7D6DDEB9E2E42316A9EFC0D7B6D0A205454B11010D44FE0C46392FFD95A4B180B9C0CB0783F00",
    "deltas": null
}
}
,
{ "get_blocks_result_v0":
{
    "head": {
        "block_num": 253185721,
        "block_id": "0F174EB908AAB71C735163B7AE4419A6B63F56654A71FBD864F2E55D72086AC7"
    },
    "last_irreversible": {
        "block_num": 253185396,
        "block_id": "0F174D7420F6888F4A8BAD6FA326732CB1A77574E55908AFE2496916B88A787D"
    },
    "this_block": {
        "block_num": 253185407,
        "block_id": "0F174D7F3C694D3EE83B3346D61566585D96A9BD45FE10FF6EE5C8D3B14D0001"
    },
    "prev_block": {
        "block_num": 253185406,
        "block_id": "0F174D7E0F5833075061B57999239235417D3C853754F355B6BB62772AFED7B4"
    },
    "block": "6A548754C0F39AD46533315500000F174D7E0F5833075061B57999239235417D3C853754F355B6BB62772AFED7B4F1ED6114F2483F6C321E17D4CD3A4A479DA3DBB5B7E4595E3761EAA96B1D44164C86779AA24851A396123FC7CEBF82885DF5EE6D0762DC4FB17B58ABE0EF2EA9E40700000000001F4B5BBC054CE026DEA32B1C8CCA317D612F7DE57E7FC60CDD24ECBC8BA814BA85369FDF5BBA6E65B49B5C836B97A846EBA054A636D09D9ADB79210123D70C99C00100CF0000000E01010020051809B678BAC4809AE2789E3D6139E0C3EB35B421D5FF82E0E1120041120F1567E606D8208371E8FB4A11F4263D885EB91F7FCE9985A2352528F99AD184BA1000004224EEB062494DDB902B350000000001A09899FE4E9CBE6A0000000000A0A693018095CB2EBA63B45500000000A8ED32321047430E00000000001B070800000000000000",
    "traces": "0200181926985ED8D0A55F58BDA0EC5753A233DF57F9760414E44D27F7F6C92EFE6B00640000000000000000000000000000000000000000000101010001000000000000EA3055D6855FFB141EA060454748DAC17797C3A5E88E02AC4E9474A88ABF6B8E9040A1E11F35EE52000000E81C2C1300000000010000000000EA3055ABA44E0F0000000011120000000000EA30550000000000EA305500000000221ACFA4010000000000EA305500000000A8ED32327469548754C0F39AD46533315500000F174D7D1724709B1438732ACEDDBFFD587CD5D9D5C54FBE381C174CB2B28A1FF8FB72681103335DF364712A14820065D0F75882C964C9960C72249A6039E7F3E3F25C945F0B10EA35D0838609C79F0AFCE099AAA165CBD6BA43EEF0559FA2B6E40700000000000000000000000000000000000000000000010000000000000000000000000000000000004F1F409C968C3407E254B169F41A61957C0B6ECE2297CB4673BACA8CC36C844400CF0000000E0000000000000000700000000000000000010101000100A09899FE4E9CBE6A507DD02452157434AD4D7AB6490CA2C38A0460661E6B1AAB277E903CA35233AAE21F35EE52000000F424310000000000018095CB2EBA63B45519800600000000005206A09899FE4E9CBE6AA09899FE4E9CBE6A0000000000A0A693018095CB2EBA63B45500000000A8ED32321047430E00000000001B07080000000000000000000000000000000000000000000000010024EEB062494DDB902B3500000000010020051809B678BAC4809AE2789E3D6139E0C3EB35B421D5FF82E0E1120041120F1567E606D8208371E8FB4A11F4263D885EB91F7FCE9985A2352528F99AD184BA1000",
    "deltas": null
}
}
]

Resolves #440

@spoonincode
Copy link
Member

Do we have any feel for what (re?) introduced this? afaict EOSIO/eos#8952 is already included in mandel which has very similar description as to what is being fixed again here.

@heifner
Copy link
Member Author

heifner commented Jun 21, 2022

Do we have any feel for what (re?) introduced this? afaict EOSIO/eos#8952 is already included in mandel which has very similar description as to what is being fixed again here.

I really am not sure what is going on here. From looking at 2.0.x, I can't see how it could have worked there.

@heifner
Copy link
Member Author

heifner commented Jun 21, 2022

Figured it out. It is the removal of reversible_db that broke this code. The old impl of fetch_block_state_by_number looked it up in the reversible_db which IS updated before the emit of accepted_block.

Copy link
Member

@spoonincode spoonincode left a comment

Choose a reason for hiding this comment

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

oh huh yup

@heifner heifner merged commit 5e3c31c into release/3.1.x Jun 21, 2022
@heifner heifner deleted the GH#440-ship-live-blocks-3.1 branch June 21, 2022 23:18
@arhag arhag changed the title Fix issue with current block not sent to SHiP clients - 3.1 [3.1] Fix issue with current block not sent to SHiP clients Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI OCI working this issue...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants