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

read-only-threads is required to submit /v1/chain/send_read_only_transaction #2104

Closed
aaroncox opened this issue Jan 18, 2024 · 4 comments · Fixed by #2106, #2115 or #2157
Closed

read-only-threads is required to submit /v1/chain/send_read_only_transaction #2104

aaroncox opened this issue Jan 18, 2024 · 4 comments · Fixed by #2106, #2115 or #2157
Assignees
Labels
bug Something isn't working 👍 lgtm OCI Work exclusive to OCI team
Milestone

Comments

@aaroncox
Copy link
Contributor

On v5.0.0, without providing read-only-theads in the config.ini - the /v1/chain/send_read_only_transaction API endpoint does not work.

Against a Jungle4 testnet node, if I execute the following query:

curl http://localhost:8888/v1/chain/send_read_only_transaction -d '{"transaction":{"signatures":[],"compression":1,"packed_context_free_data":"789c63000000010001","packed_trx":"789c636040068c06c71c8e2f48be60c830a52fedfceacdbb1838c0e2528bb31800a31509a1"}}'

The response from curl is:

curl: (52) Empty reply from server

Now if I modify the config and add read-only-theads = 4, and rerun the same curl command, I get a response:

{"transaction_id":"f0ec94d0dfdfd810cbdfb88d6ee43e6314e0fea623886ecccfb35284f1ee48be","processed":{"id":"f0ec94d0dfdfd810cbdfb88d6ee43e6314e0fea623886ecccfb35284f1ee48be","block_num":119599286,"block_time":"2024-01-18T06:47:55.000","producer_block_id":null,"receipt":{"status":"executed","cpu_usage_us":0,"net_usage_words":9},"elapsed":369,"net_usage":72,"scheduled":false,"action_traces":[{"action_ordinal":1,"creator_action_ordinal":0,"closest_unnotified_ancestor_action_ordinal":0,"receipt":{"receiver":"abcabcabc333","act_digest":"c065e5fbaadf68523d6da2ea62aa49cf876468ec441aea6c6ece2263b35ed8a9","global_sequence":0,"recv_sequence":0,"auth_sequence":[],"code_sequence":5,"abi_sequence":5},"receiver":"abcabcabc333","act":{"account":"abcabcabc333","name":"returnvalue","authorization":[],"data":{"message":"hello"},"hex_data":"00000000001aa36a"},"context_free":false,"elapsed":333,"console":"","trx_id":"f0ec94d0dfdfd810cbdfb88d6ee43e6314e0fea623886ecccfb35284f1ee48be","block_num":119599286,"block_time":"2024-01-18T06:47:55.000","producer_block_id":null,"account_ram_deltas":[],"except":null,"error_code":null,"return_value_hex_data":"1656616c69646174696f6e20686173207061737365642e","return_value_data":"Validation has passed."}],"account_ram_delta":null,"except":null,"error_code":null}}

The configuration that is causing the error is as follow, with read-only-threads commented out.

chain-threads = 2
net-threads = 2
http-threads = 2
# read-only-threads = 4
wasm-runtime = eos-vm-jit

# api
enable-account-queries = true
http-server-address = 0.0.0.0:12888
p2p-listen-endpoint = 0.0.0.0:12876
verbose-http-errors = true
http-validate-host = false

# state
read-mode = head
validation-mode = full
chain-state-db-size-mb = 131070

# blocks - Retain 24 hours worth of blocks (2 * 60 * 60 * 24 = 172800)
blocks-dir = "/eosio/blocks"
block-log-retain-blocks = 172800

# plugins
plugin = eosio::chain_plugin eosio::chain_api_plugin
plugin = eosio::http_plugin

Any ideas?

@heifner
Copy link
Member

heifner commented Jan 18, 2024

I have not tested your config.ini, however doesn't look like you are specifying eosio::chain_api_plugin as it is on the same line as eosio::chain_plugin.

plugin = eosio::chain_plugin eosio::chain_api_plugin
plugin = eosio::chain_plugin
plugin = eosio::chain_api_plugin

@spoonincode
Copy link
Member

That's a valid way of specifying plugins because of this oddity,
https://github.com/AntelopeIO/appbase/blob/main/application_base.cpp#L404
so it makes sense why,

auto i = std::find_if(v.cbegin(), v.cend(), [](const std::string& p) { return p == "eosio::chain_api_plugin"; });

wouldn't find it.

@spoonincode spoonincode added bug Something isn't working 👍 lgtm and removed triage labels Jan 18, 2024
@spoonincode spoonincode self-assigned this Jan 18, 2024
@spoonincode spoonincode moved this from Todo to In Progress in Team Backlog Jan 18, 2024
@spoonincode spoonincode moved this from In Progress to Awaiting Review in Team Backlog Jan 18, 2024
@aaroncox
Copy link
Contributor Author

Wow good catch... and that's quite the obscure bug 😂

We have specified multiple plugins on the same line like that since EOS launched, kind of grouping the ones that go together on the same line to enable/disable the pairing at the same time.

I'll understand based on this situation though if moving forward we should deprecate that method of specifying plugins.

@heifner
Copy link
Member

heifner commented Jan 29, 2024

Current fix is not finding chain_api_plugin initialized during producer_plugin initialize on hotstuff_integration branch.

@heifner heifner assigned heifner and unassigned spoonincode Jan 29, 2024
@heifner heifner added the OCI Work exclusive to OCI team label Jan 29, 2024
heifner added a commit that referenced this issue Jan 29, 2024
heifner added a commit that referenced this issue Jan 29, 2024
…n-5.0

[5.0] More robust `chain_api_plugin` check in `producer_plugin`; take 2
heifner added a commit that referenced this issue Jan 29, 2024
heifner added a commit that referenced this issue Jan 29, 2024
…n-main

[5.0 -> main] More robust `chain_api_plugin` check in `producer_plugin`; take 2
@github-project-automation github-project-automation bot moved this from Todo to Done in Team Backlog Jan 29, 2024
@BenjaminGormanPMP BenjaminGormanPMP added this to the Leap v5.0.1 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment