Skip to content

fix: migrate get_dynamic_global_properties from database_api to condenser_api - #372

Merged
kuny0707 merged 1 commit into
masterfrom
fix/migrate-database-api-to-condenser-api
Jun 8, 2026
Merged

fix: migrate get_dynamic_global_properties from database_api to condenser_api#372
kuny0707 merged 1 commit into
masterfrom
fix/migrate-database-api-to-condenser-api

Conversation

@ety001

@ety001 ety001 commented Jun 5, 2026

Copy link
Copy Markdown
Member

Problem

get_dynamic_global_properties in hive/steem/http_client.py still maps to database_api, while all other methods in METHOD_API already use condenser_api.

This causes a Bad Cast error when the request reaches steemd, because:

  1. _rpc_body() generates params={} for database_api methods (line 78)
  2. jussi Go translateToAppbase rewrites database_api.*condenser_api.* but does not normalize params format
  3. steemd appbase requires params=[] (array) for condenser_api methods
  4. Result: Bad Cast: Invalid cast from object_type to Array

Fix

Change the METHOD_API mapping:

# Before
get_dynamic_global_properties='database_api',

# After
get_dynamic_global_properties='condenser_api',

_rpc_body() already has the logic to use [] for condenser_api methods (line 78: args = [] if 'condenser_api' in method else {}), so this one-line change fixes both the namespace and the params format.

Context

  • database_api is a low-level steemd plugin API being phased out
  • condenser_api is the public-facing high-level API that wraps database_api, follow_api, tags_api
  • jussi (both Go and Python) already translates all database_api.* calls to condenser_api.* via translateToAppbase
  • hivemind only serves condenser_api (asserts api == 'condenser_api' in call.py)
  • This was the last remaining database_api usage in hivemind's HTTP client

Testing

Verified against api.steemit.com:

# database_api + object params → Bad Cast ❌
curl -s -X POST https://api.steemit.com \
  -d '{"jsonrpc":"2.0","method":"database_api.get_dynamic_global_properties","params":{},"id":1}' \
  -H 'Content-Type: application/json'

# condenser_api + array params → Success ✅
curl -s -X POST https://api.steemit.com \
  -d '{"jsonrpc":"2.0","method":"condenser_api.get_dynamic_global_properties","params":[],"id":1}' \
  -H 'Content-Type: application/json'

…nser_api

database_api is a legacy low-level steemd plugin API that is being
phased out. condenser_api is the public-facing high-level API that
wraps database_api and other plugin APIs (follow_api, tags_api).

This change also fixes a Bad Cast error: database_api expects params
as {} (object) while condenser_api expects [] (array). The _rpc_body
helper already handles this correctly based on the method name prefix,
so only the METHOD_API mapping needed updating.

All other methods in METHOD_API already use condenser_api (or block_api);
get_dynamic_global_properties was the last remaining database_api usage.
@kuny0707
kuny0707 merged commit c818e80 into master Jun 8, 2026
1 check passed
@ety001
ety001 deleted the fix/migrate-database-api-to-condenser-api branch June 8, 2026 14:41
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

Successfully merging this pull request may close these issues.

2 participants