-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #417 from rsksmart/calls
Improve empty Bridge response when called from a smart contract
- Loading branch information
Showing
3 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
rskip: 417 | ||
title: Avoid transactions to be reverted when Bridge method calls from smart contracts return an empty response | ||
created: 28-FEB-24 | ||
author: MI | ||
purpose: Usa | ||
layer: Core | ||
complexity: 1 | ||
status: Draft | ||
description: | ||
--- | ||
|
||
|RSKIP |417 | | ||
| :------------ |:-------------| | ||
|**Title** |Avoid transactions to be reverted when Bridge method calls from smart contracts return an empty response | | ||
|**Created** |28-FEB-24 | | ||
|**Author** |MI | | ||
|**Purpose** |Usa | | ||
|**Layer** |Core | | ||
|**Complexity** |1 | | ||
|**Status** |Draft | | ||
|
||
## Abstract | ||
|
||
When a Bridge method with no return value is called from a smart contract it causes the node to throw a null pointer exception and the transaction to be reverted. This RSKIP proposes a change so that no exception is thrown and the transaction is not reverted. | ||
|
||
## Motivation | ||
|
||
There are currently 6 Bridge methods that have no return value. | ||
|
||
- addSignature | ||
- receiveHeaders | ||
- registerBtcCoinbaseTransaction | ||
- registerBtcTransaction | ||
- releaseBtc | ||
- updateCollections | ||
|
||
If any of these methods were to be called from a smart contract, the transaction would get automatically reverted. | ||
|
||
## Specification | ||
|
||
When the Bridge executes a method that has no return value, return an empty byte array instead of `null`. | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters