-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/hf-audit-recursion
- Loading branch information
Showing
409 changed files
with
11,274 additions
and
37,247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
title: Appendix | ||
sidebar_label: Appendix | ||
hide_title: true | ||
description: Berkeley Upgrade Appendix | ||
keywords: | ||
- Berkeley | ||
- upgrade | ||
- appendix | ||
--- | ||
|
||
# Appendix | ||
|
||
## Migration from o1labs/client-sdk to mina-signer | ||
|
||
The signing library `o1labs/client-sdk` was deprecated some time ago and will stop working after the Mina mainnet upgrade. All users should upgrade to use the [mina-signer](https://www.npmjs.com/package/mina-signer) library. | ||
|
||
Below you will find an example of how to use the `mina-signer` library. Please keep in mind the following: | ||
|
||
1. Make sure to adjust the `nonce` to the correct nonce on the account you want to use as "sender" | ||
1. Update the `url` variable with an existing Mina Node GraphQL endpoint | ||
|
||
```javascript | ||
import { Client } from 'mina-signer'; | ||
|
||
// create the client and define the keypair | ||
|
||
const client = new Client({ network: 'testnet' }); // Mind the `network` client configuration option | ||
|
||
const senderPrivateKey = 'EKFd1Gx...'; // Sender's private key | ||
const senderPublicKey = 'B62qrDM...'; // Sender's public key, perhaps derived from the private key using `client.derivePublicKey(senderPrivateKey)`; | ||
|
||
// define and sign payment | ||
|
||
let payment = { | ||
from: senderPublicKey, | ||
to: 'B62qkBw...', // Recipient public key | ||
amount: 100, | ||
nonce: 1, | ||
fee: 1000000, | ||
}; | ||
|
||
const signedPayment = client.signPayment(payment, senderPrivateKey); | ||
|
||
// send payment to graphql endpoint | ||
|
||
const url = 'https://qanet.minaprotocol.network/graphql'; | ||
|
||
const sendPaymentMutationQuery = ` | ||
mutation SendPayment($input: SendPaymentInput!, $signature: SignatureInput!) { | ||
sendPayment(input: $input, signature: $signature) { | ||
payment { | ||
hash | ||
} | ||
} | ||
} | ||
`; | ||
const graphQlVariables = { | ||
input: signedPayment.data, | ||
signature: signedPayment.signature, | ||
}; | ||
const body = JSON.stringify({ | ||
query: sendPaymentMutationQuery, | ||
variables: graphQlVariables, | ||
operationName: 'SendPayment', | ||
}); | ||
|
||
const paymentResponse = await fetch(url, { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body | ||
}); | ||
|
||
const paymentResponseJson = await paymentResponse.json(); | ||
if (paymentResponse.ok) { | ||
console.log(`Transaction hash: ${paymentResponseJson.data.sendPayment.payment.hash}`); | ||
} else { | ||
console.error(JSON.stringify(paymentResponseJson)); | ||
} | ||
|
||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
--- | ||
title: Appendix | ||
sidebar_label: Appendix | ||
hide_title: true | ||
description: archive node schema changes between Mainnet and Berkeley | ||
keywords: | ||
- Berkeley | ||
- upgrade | ||
- archive migration | ||
- appendix | ||
- mina archive node | ||
- archive node | ||
--- | ||
|
||
# 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` |
Oops, something went wrong.