Skip to content

Latest commit

 

History

History
102 lines (79 loc) · 3.44 KB

fip-0047.md

File metadata and controls

102 lines (79 loc) · 3.44 KB
fip title status type author created updated
47
Allow FIO Block Producers to update their information
Final
Functionality
Eric Butz <[email protected]>
2022-11-17
2024-01-19

Abstract

This FIP proposes to extend FIO Protocol functionality to enable FIO Block Producers to use regproducer to update their producer information.

Modified actions

Contract Action Endpoint Description
eosio regproducer /register_producer Modifies the action to allow the updating of specific fields.

Motivation

Currently, regproducer can only be used to create new producer records. If a producer calls regproducer to update their information, they get an error: Already registered as a producer. FIO Block Producers have requested an enhancement to the protocol to allow the use of regproducer to update their information.

Specification

Modified actions

Register Producer

  • Register a new block producer
  • Update public key, location, url for a registered block producer

Contract: eosio

Action: regproducer

End point: /register_producer

Request

Parameter Required Format Definition
fio_address Yes FIO Address Valid FIO Crypto Handle
fio_pub_key Yes FIO Public Key The producer's public key that is used for signing.
url Yes Producer URL URL of block producer's website.
location Yes Producer Location Location ID of where BPs servers are located.
actor Yes 12 character string Valid actor of signer
max_fee Yes Positive Int Maximum amount of SUFs the user is willing to pay for fee. Should be preceded by /get_fee for correct value.

Example


{
  "fio_address": "producer@bob",
  "fio_pub_key": "FIO7tHihSLJVRQ2HsiVGTXAh3RgfXQvVVPpMm8pwQtiTHQHPnY5dH",
  "url": "https://bobp.io/",
  "location": 80,
  "actor": "aftyershcu22",
  "max_fee": 10000000000
}

Processing

  • Validate inputs as necessary
  • Only fio_address, url, producer_public_key and location can be updated
  • If registering new producer (owner does not exist in the table)
    • Confirm fio_address is registered to owner
    • The actor is authorized to emplace on behalf of the actor parameter
    • A FIO Handle cannot be used again unless it has a new owner (actor)
    • Emplace new producer record. The "actor"
  • If owner already exists in producers table:
    • If fio_address is changed, confirm it is registered to owner and update
    • Update url, producer_public_key and location parameters (should be validated similar to new record)

Exception Handling

The following exception handling conditions are altered. If the producer is active, assert the url, public_key or location are different and can be updated.

Error condition Trigger Type fields:name fields:value Error message
ErrorFioNameNotReg Producer calls regproducer and is already in producer table with is_active=1. 400 "actor" Value sent in "Already registered as producer"

Response

{
  "status":"OK",
  "fee_collected":"10000000000"
}

Rationale

Change is required to facilitate updating of producer records.

Implementation

https://github.com/fioprotocol/fio.contracts/tree/feature/regproducer_update

Backwards Compatibility

No backwards compatibility issues.

Future considerations

None

Discussion link

https://fioprotocol.atlassian.net/browse/BD-4075