# Casper Node SSE Stream Changes Between 1.1.2 and 1.2.0 ## Changes to `BlockAdded` Event ### `block.header.era_end.era_report.rewards` Changed from a JSON object where names are public keys and values are numbers, to a JSON array of objects of type: ```json {"validator":"hex-encoded public key string","amount":number} ``` 1.1.2 example: ```json "rewards":{ "012a21e233b86ceeb6eba21b06a14dece531dde11b775e3e07f389876c10516297":2000000000000, "01338dcea61f5c0472c5a74ee36c5a07d710ee4e402b9929ae930376a520a83308":1999999999990 } ``` 1.2.0 example: ```json "rewards":[ {"validator":"014e32447b87ed0ac411ae16f0c490c3e8f650f88c1729fc40089ac107e39fbf61","amount":2000000000000}, {"validator":"017fcb7cf2383794a263e676e7e89489e1e0b666a7ef6bb73cbddcd47469cdad82","amount":1999999999990} ] ``` --- ### `block.header.era_end.next_era_validator_weights` Changed from a JSON object where names are public keys and values are strings representing unsigned 512-bit numbers, to a JSON array of objects of type: ```json {"validator":"hex-encoded public key string","weight":"U512 as decimal string"} ``` 1.1.2 example: ```json "next_era_validator_weights":{ "012a21e233b86ceeb6eba21b06a14dece531dde11b775e3e07f389876c10516297":"2000000000000010", "01338dcea61f5c0472c5a74ee36c5a07d710ee4e402b9929ae930376a520a83308":"2000000000000004" } ``` 1.2.0 example: ```json "next_era_validator_weights":[ {"validator":"014e32447b87ed0ac411ae16f0c490c3e8f650f88c1729fc40089ac107e39fbf61","weight":"2000000000000010"}, {"validator":"01e220886b67b7fb4ccbcb7750c243e29cf7b2a4000032c2cbf4550786aff74988","weight":"2000000000000002"} ] ``` --- ### `block.proofs` Added this field to `block`. Its value is a JSON array of objects of type: ```json {"public_key":"hex-encoded public key string","signature":"hex-encoded signature string"} ``` It was added to the JSON representation of a block to enable providing proofs as part of a JSON RPC update. The same block type is used in the event stream, but when blocks are added to the event stream they have no proofs, so the `block.proofs` value will in practice always be an empty JSON array. --- ## Addition of `Step` Event The stream now also outputs a `Step` event towards the end of each era. It normally falls immediately before a switch block is output, but there may occasionally be a few events (e.g. `FinaltySignature`s) between them. Its value is a JSON object of type: ```json { "era_id":number, "execution_effect":{ "operations":[ { "key":"formatted string representing a Key in global state", "kind":"string representing an operation performed under that key" } ], "transforms":[ { "key":"formatted string representing a Key in global state", "transform":"string representing a transformation performed on global state" } ] } } ``` For a comprehensive OpenRPC schema description of `execution_effect`, it has the same type as the field `result.execution_results.0.result.Success.effect` of the response to an `info_get_deploy` JSON-RPC. The OpenRPC schema can be accessed via the Rust client, e.g. ``` casper-client list-rpcs -n http://<IP>:7777 ``` The schema can be better visualised by pasting the value of the `result.schema` field of the response into [the OpenRPC playground](https://playground.open-rpc.org/). To summarise: * `operations.key` and `transforms.key` can have one of the following possible values: * `"account-hash-<64 hex chars>"` * `"hash-<64 hex chars>"` * `"uref-<64 hex chars>-<3 digit number between 000 to 007 inclusive>"` * `"transfer-<64 hex chars>"` * `"deploy-<64 hex chars>"` * `"era-<number>"` * `"balance-<64 hex chars>"` * `"bid-<64 hex chars>"` * `"withdraw-<64 hex chars>"` * `operations.kind` can have one of the following possible values: * `"Read"` * `"Write"` * `"Add"` * `"NoOp"` * `transforms.transform` can have one of the possible values described succinctly via [the Rust source code](https://github.com/casper-network/casper-node/blob/release-1.2/types/src/execution_result.rs#L431-L472) ---