Skip to main content

Appendix

Archive node schema changes

If you are using the Archive Node database directly for your system integrations, then you should understand all the changes that might impact your applications. The most important change is that the balances table in the Berkeley schema will no longer exist. In the new schema, it is replaced with the table accounts_accessed - from an application semantics point of view, the data in accounts_accessed is still the same.

In the Berkeley protocol, accounts can now have the same public key but a different token_id. This means accounts are identified by both their public key and token_id, not just the public key. Consequently, the foreign key for the account in all tables is account_identifier_id instead of public_key_id.

Schema differences

  • Removed Types
    • The options create_token, create_account, and mint_tokens have been removed from the user_command_type enumeration.
  • Indexes Dropped
    • We've removed several indexes from tables, this may affect how you search and organize data:
      • idx_public_keys_id
      • idx_public_keys_value
      • idx_snarked_ledger_hashes_value
      • idx_blocks_id
      • idx_blocks_state_hash
  • Table Removed
    • The balances table is no longer available.
  • New Tables Added
    • We've introduced the following new tables:
      • tokens
      • token_symbols
      • account_identifiers
      • voting_for
      • protocol_versions
      • accounts_accessed
      • accounts_created
      • zkapp_commands
      • blocks_zkapp_commands
      • zkapp_field
      • zkapp_field_array
      • zkapp_states_nullable
      • zkapp_states
      • zkapp_action_states
      • zkapp_events
      • zkapp_verification_key_hashes
      • zkapp_verification_keys
      • zkapp_permissions
      • zkapp_timing_info
      • zkapp_uris
      • zkapp_updates
      • zkapp_balance_bounds
      • zkapp_nonce_bounds
      • zkapp_account_precondition
      • zkapp_accounts
      • zkapp_token_id_bounds
      • zkapp_length_bounds
      • zkapp_amount_bounds
      • zkapp_global_slot_bounds
      • zkapp_epoch_ledger
      • zkapp_epoch_data
      • zkapp_network_precondition
      • zkapp_fee_payer_body
      • zkapp_account_update_body
      • zkapp_account_update
      • zkapp_account_update_failures
  • Updated Tables
    • The following tables have been updated
      • timing_info
      • user_commands
      • internal_commands
      • epoch_data
      • blocks
      • blocks_user_commands
      • blocks_internal_commands

Differences per table

  • timing_info
    • Removed columns:
      • token
      • initial_balance
  • user_commands
    • Removed columns:
      • fee_token
      • token
  • internal_commands
    • Removed columns:
      • token
    • Renamed column
      • command_type to type
  • epoch_data
    • Added columns:
      • total_currency
      • start_checkpoint
      • lock_checkpoint
      • epoch_length
  • blocks
    • Added columns:
      • last_vrf_output
      • min_window_density
      • sub_window_densities
      • total_currency
      • global_slot_since_hard_fork
      • global_slot_since_genesis
      • protocol_version_id
      • proposed_protocol_version_id
    • Removed column:
      • global_slot
  • blocks_user_commands
    • Removed columns:
      • fee_payer_account_creation_fee_paid
      • receiver_account_creation_fee_paid
      • created_token
      • fee_payer_balance
      • source_balance
      • receiver_balance
    • Added index:
      • idx_blocks_user_commands_sequence_no
  • blocks_internal_commands
    • Removed columns:
      • receiver_account_creation_fee_paid
      • receiver_balance
    • Added indexes:
      • idx_blocks_internal_commands_sequence_no
      • idx_blocks_internal_commands_secondary_sequence_no

Rosetta API new operations

The Berkeley upgrade introduces two new operation types:

  • zkapp_fee_payer_dec
  • zkapp_balance_change