Skip to content
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

Add detailed Soroban resource fee info in txmeta (next) #176

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,52 @@ struct DiagnosticEvent
ContractEvent event;
};

struct SorobanTransactionMeta
struct SorobanTransactionMetaExtV1
{
ExtensionPoint ext;

// The following are the components of the overall Soroban resource fee
// charged for the transaction.
// The following relation holds:
// `resourceFeeCharged = totalNonRefundableResourceFeeCharged + totalRefundableResourceFeeCharged`
// where `resourceFeeCharged` is the overall fee charged for the
// transaction. Also, `resourceFeeCharged` <= `sorobanData.resourceFee`
// i.e.we never charge more than the declared resource fee.
// The inclusion fee for charged the Soroban transaction can be found using
// the following equation:
// `result.feeCharged = resourceFeeCharged + inclusionFeeCharged`.

// Total amount (in stroops) that has been charged for non-refundable
// Soroban resources.
// Non-refundable resources are charged based on the usage declared in
// the transaction envelope (such as `instructions`, `readBytes` etc.) and
// is charged regardless of the success of the transaction.
int64 totalNonRefundableResourceFeeCharged;
// Total amount (in stroops) that has been charged for refundable
// Soroban resource fees.
// Currently this comprises the rent fee (`rentFeeCharged`) and the
// fee for the events and return value.
// Refundable resources are charged based on the actual resources usage.
// Since currently refundable resources are only used for the successful
// transactions, this will be `0` for failed transactions.
int64 totalRefundableResourceFeeCharged;
// Amount (in stroops) that has been charged for rent.
// This is a part of `totalNonRefundableResourceFeeCharged`.
int64 rentFeeCharged;
};

union SorobanTransactionMetaExt switch (int v)
{
case 0:
void;
case 1:
SorobanTransactionMetaExtV1 v1;
};

struct SorobanTransactionMeta
{
SorobanTransactionMetaExt ext;

ContractEvent events<>; // custom events populated by the
// contracts themselves.
SCVal returnValue; // return value of the host fn invocation
Expand Down
Loading