casper-network / casper-node

Reference client for CASPER protocol
https://casper.network
Apache License 2.0
391 stars 222 forks source link

Define canonical transaction #4851

Closed devendran-m closed 3 weeks ago

devendran-m commented 2 months ago

Define the actual canonical transaction as something like this;


pub struct TransactionV1 {
    hash: Digest,

    chain_name: String,
    protocol_version: ProtocolVersion,
    timestamp: Timestamp,
    ttl: TimeDiff,
    initiator_addr: InitiatorAddr,

    fields: BTreeMap<u16, Bytes>,

    approvals: BTreeSet<Approval>,
    #[cfg_attr(any(all(feature = "std", feature = "once_cell"), test), serde(skip))]
    #[cfg_attr(
        all(any(feature = "once_cell", test), feature = "datasize"),
        data_size(skip)
    )]
    #[cfg(any(feature = "once_cell", test))]
    is_verified: OnceCell<Result<(), InvalidTransaction>>,
devendran-m commented 1 month ago

Hi @zajko ,

As advised by Ed in the L1 daily on 16th Sep, sharing the brief note here for your reference;