Skip to content

More detailed results of the execution of the CANCELALLUNFREEZEV2(0xdc) opcode #5530

@yanghang8612

Description

@yanghang8612

Rationale

When the system contract wallet/cancelallunfreezev2 is executed, we can distinguish the amount of bandwidth/energy/tronpower canceled in this cancellation operation respectively by the transaction execution result. However, for the CANCELALLUNFREEZEV2(0xdc) opcode in TVM, it only produces an internal transaction containing the overall canceled amount, and cannot distinguish the canceled amount of each of the three resources.

Implementation

Internal transaction is defined below:

message InternalTransaction {
  // internalTransaction identity, the root InternalTransaction hash
  // should equals to root transaction id.
  bytes hash = 1;
  // the one send trx (TBD: or token) via function
  bytes caller_address = 2;
  // the one recieve trx (TBD: or token) via function
  bytes transferTo_address = 3;
  message CallValueInfo {
    // trx (TBD: or token) value
    int64 callValue = 1;
    // TBD: tokenName, trx should be empty
    string tokenId = 2;
  }
  repeated CallValueInfo callValueInfo = 4;
  bytes note = 5;
  bool rejected = 6;
  string extra = 7;
}
  • Option A: Add three new types of internal transactions, like cancelAllUnfreezeV2ForBandwidth, cancelAllUnfreezeV2ForEnergy and cancelAllUnfreezeV2ForTronPower
  • Option B: Save the amount of three resource cancellations in the extra field, the format should preferably be in json.

Discussions

Q: Does it need a hard fork?

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions