Skip to content

Commit

Permalink
Merge pull request #417 from rsksmart/calls
Browse files Browse the repository at this point in the history
Improve empty Bridge response when called from a smart contract
  • Loading branch information
aeidelman authored Mar 4, 2024
2 parents 3ea70ee + 30acc42 commit 763c862
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IPs/RSKIP185.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
rskip: 185
title: Peg-out refund and events
description:
status: Draft
status: Adopted
purpose: Usa
author: JD (@josedahlquist)
layer: Core
Expand All @@ -19,7 +19,7 @@ created: 2020-11-19
|**Purpose** |Usa |
|**Layer** |Core |
|**Complexity** |1 |
|**Status** |Draft |
|**Status** |Adopted |

## Abstract

Expand Down
46 changes: 46 additions & 0 deletions IPs/RSKIP417.md
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/).
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ You can find an easily browseable version of this information [here](https://ips
| 412 |[BASEFEE instruction](IPs/RSKIP412.md)| 9-NOV-23 | VK | Usa | Core | 2 | Draft |
| 414 |[Network Upgrade: Arrowhead](IPs/RSKIP414.md)| 7-DEC-23 | VK | Usa,Sec | Core | 2 | Draft |
| 415 |[Fix pegnatories address derivation from public keys](IPs/RSKIP415.md)| 30-JAN-24 | MI | Usa | Core | 1 | Draft |
| 417 |[Avoid transactions to be reverted when Bridge method calls from smart contracts return an empty response](IPs/RSKIP417.md)| 28-FEB-24 | MI | Usa | Core | 1 | Draft |

(*) Under evaluation to be implemented in the next reference client release

Expand Down

0 comments on commit 763c862

Please sign in to comment.