-
Notifications
You must be signed in to change notification settings - Fork 601
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
Account Id change caused neard to break on testnet #4600
Comments
@miraclx I feel like the issue is in the genesis records (genesis.json file) since it crashed right away, but it is super odd.
|
Indeed. It is possible that genesis contains an invalid account id for some reason |
Indeed it does (and not just one), here's one such example in {
"AccessKey": {
"account_id": "figment.test2",
"public_key": "ed25519:3KA1iGnyAa8ZWj1e27GxG38oW15BkrZF2PGQkCATJdxe",
"access_key": {
"nonce": 0,
"permission": {
"FunctionCall": {
"allowance": "100000000",
"receiver_id": "",
"method_names": []
}
}
}
}
},
|
The behavior is technically legal but should not have been. Such access keys are useless -- any transactions signed by them will result in a |
# refactor: Introduce strictly typed and assuredly validated AccountId (#4440) This PR introduces a strictly typed structure - `AccountId` that enforces account ID validation. This way, we can ensure validity and thereby fail fast before an invalid account name is used. This also, optionally, ensures validation on {,de}serialization so, yeah.. The structure is defined within its own self-contained crate `near-account-id` to allow for easy publishing. The extra dependencies - `borsh`, `serde` are made optional to allow the crate to be lightweight enough to be depended upon. Within `nearcore`, the structure is reexported via `near_primitives::AccountId` and the crate via `near_primitives{,_core}::account::id` with default features (`borsh`, `serde`) but you can opt-out of those by depending on it directly. Resolves #2074, supersedes #2831. * [x] Existing unit tests pass with minor updates * [x] Nayduck tests pass without modifications * [x] Manually ensured that the protocol is not changed # impl workaround for invalid AccessKey-s in genesis records (resolves #4600) * [x] Manually booted a testnet node to ensure genesis loads properly and that no further AccountId-related issues occur. * [x] Ensured unit tests pass with no further updates * [x] Nayduck tests pass without modifications
To reproduce:
spin up a node on testnet with a commit that contains #4440 and observe that it produces the error above.
The text was updated successfully, but these errors were encountered: