Actions

Direct request: Difference between revisions

From Chainlink Community Wiki

No edit summary
No edit summary
 
(44 intermediate revisions by the same user not shown)
Line 1: Line 1:
__TOC__
__TOC__
<h2>Price Feeds: Direct Request / Runlog (DR)</h2>
<h2>Price Feeds: Direct Request / Runlog (DR)</h2>
<p>The first iteration, and quite possibly the most adaptive, of Chainlink contract was the Direct Request, also referred to as Runlog, model.</p>
<p>The first iteration, and quite possibly the most adaptive Chainlink contract was the Direct Request, also referred to as Runlog, model.</p>
<p>This deployment methodology was not specifically designed for price feeds, rather it was designed to enable a wide range of data to be provided on-chain.<br>As such, it was easy to deploy and maintain, but it was not able to scale efficiently.<br>Once DeFi protocols started seeing significant levels of adoption, the number of Price Feeds as well as the rate at which they updated started to increase rapidly.</p>
<p>This deployment methodology was not specifically designed for price feeds, rather it was designed to enable a wide range of data to be provided on-chain.<br>As such, it was easy to deploy and maintain, but it was not able to scale efficiently.<br>Once DeFi protocols started seeing significant levels of adoption, the number of Price Feeds as well as the rate at which they updated started to increase rapidly.</p>
<p>This section will cover the history of the Direct Request Price Feeds, using the first ever contract ( ETH / USD) as the example.</p>
<p>This following section will cover the history of the Direct Request Price Feeds, using the first ever contract ( ETH / USD) as the example.</p>
----
----
===The First Ever Price Feed: ETH / USD===
===The First Ever Price Feed: ETH / USD===
<p>The original ETH / USD Price Feed was deployed at address <a href="https://etherscan.io/address/0x79febf6b9f76853edbcbc913e6aae8232cfb9de9#readContract"><strong>0x79fEbF6B9F76853EDBcBc913e6aAE8232cFB9De9</strong></a> at transaction address <a href="https://etherscan.io/tx/0x9f2791fdc6b1654d593d3ce99a025c0da375541334e26d4ea9215c9cac8a933b"><strong>0x9f2791fdc6b1654d593d3ce99a025c0da375541334e26d4ea9215c9cac8a933b</strong></a>.</p>
<p>The original ETH / USD Price Feed was deployed at address - <strong>[https://etherscan.io/address/0x79febf6b9f76853edbcbc913e6aae8232cfb9de9#readContract 0x79fEbF6B9F76853EDBcBc913e6aAE8232cFB9De9]</strong></p>
<p>The first three node operators were Fiews, LinkPool, and Chainlink. Fiews and Link Pool were community members that had made contributions to the Chainlink network before the mainnet launch.</p>
<p>With transaction address - <strong>[https://etherscan.io/tx/0x9f2791fdc6b1654d593d3ce99a025c0da375541334e26d4ea9215c9cac8a933b 0x9f2791fdc6b1654d593d3ce99a025c0da375541334e26d4ea9215c9cac8a933b]</strong></p>
 
The first three node operators were  
* <big>[[Fiews]]</big>
* <big>[[Linkpool]]</big>
* <big>Chainlink</big>
 
<p>Fiews and Link Pool were community members that had made contributions to the Chainlink network before the mainnet launch.</p>
<p>Runlog contracts, also referred to as Direct Request contracts, require that an on-chain request be sent to each Chainlink Node Operator (how this operates is covered in more detail in the RunLog section of the wiki).</p>
<p>Runlog contracts, also referred to as Direct Request contracts, require that an on-chain request be sent to each Chainlink Node Operator (how this operates is covered in more detail in the RunLog section of the wiki).</p>
<p>As a result of this requirement, the Chainlink Deviator / Utility Node was built. This Chainlink Node had just one purpose; to monitor the price of ETH / USD. &nbsp;When the price of ETH / USD deviated above a specified threshold, a request was sent to each Node Operator's Oracle.sol contract. This then triggered a job run on each of the Nodes, which resulted in an updated price on-chain.</p>
<p>As a result of this requirement, the Chainlink Deviator / Utility Node was built. This Chainlink Node had just one purpose; to monitor the price of ETH / USD. &nbsp;When the price of ETH / USD deviated above a specified threshold, a request was sent to each Node Operator's Oracle.sol contract. This triggered a job run on each of the Nodes, which resulted in an updated price on-chain.</p>
<p>&nbsp;</p>
----
<h3>Direct Request Operation</h3>
===Direct Request Operation===
<p>The timeline for these events is as follows:</p>
<p>The timeline for these events is as follows:</p>
<ul>
<ul>
   <li>Deviator / Utility Node detects deviation greater than deviation threshold<ul>
   <li>Deviator / Utility Node detects deviation greater than deviation threshold<ul>
       <li>Deviator / Utility Node Address: <a href="https://etherscan.io/address/0xd8Aa8F3be2fB0C790D3579dcF68a04701C1e33DB"><strong>0xd8Aa8F3be2fB0C790D3579dcF68a04701C1e33DB</strong></a></li>
       <li>Deviator / Utility Node Address:
<strong>[https://etherscan.io/address/0xd8Aa8F3be2fB0C790D3579dcF68a04701C1e33DB 0xd8Aa8F3be2fB0C790D3579dcF68a04701C1e33DB]</strong></li>
     </ul>
     </ul>
   </li>
   </li>
   <li>Deviator / Utility Node sends a request to each Chainlink Node's <a href="https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.6/Oracle.sol">Oracle.sol</a> contract<ul>
<br>
       <li>Fiews Oracle.sol Contract Address: <a href="https://etherscan.io/address/0x049Bd8C3adC3fE7d3Fc2a44541d955A537c2A484"><strong>0x049Bd8C3adC3fE7d3Fc2a44541d955A537c2A484</strong></a></li>
   <li>Deviator / Utility Node sends a request to each Chainlink Node's [https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.6/Oracle.sol Oracle.sol] contract<ul>
       <li>LinkPool Oracle.sol Contract Address: <a href="https://etherscan.io/address/0x240BaE5A27233Fd3aC5440B5a598467725F7D1cd"><strong>0x240BaE5A27233Fd3aC5440B5a598467725F7D1cd</strong></a></li>
       <li>Fiews Oracle.sol Contract Address:<strong>[https://etherscan.io/address/0x049Bd8C3adC3fE7d3Fc2a44541d955A537c2A484 0x049Bd8C3adC3fE7d3Fc2a44541d955A537c2A484]</strong></li>
       <li>Chainlink Oracle.sol Contract Address: <a href="https://etherscan.io/address/0x89f70fA9F439dbd0A1BC22a09BEFc56adA04d9b4"><strong>0x89f70fA9F439dbd0A1BC22a09BEFc56adA04d9b4</strong></a></li>
       <li>LinkPool Oracle.sol Contract Address: <strong>[https://etherscan.io/address/0x240BaE5A27233Fd3aC5440B5a598467725F7D1cd 0x240BaE5A27233Fd3aC5440B5a598467725F7D1cd]</strong></li>
       <li>Chainlink Oracle.sol Contract Address: <strong>[https://etherscan.io/address/0x89f70fA9F439dbd0A1BC22a09BEFc56adA04d9b4 0x89f70fA9F439dbd0A1BC22a09BEFc56adA04d9b4]</strong></li>
<br>
     </ul>
     </ul>
   </li>
   </li>
Line 30: Line 40:
     </ul>
     </ul>
   </li>
   </li>
<br>
   <li>Each of the Chainlink Nodes then run the requested Job, which will get the price of ETH / USD from their respective data providers. &nbsp;Once each node has an updated price, they will provide that value on-chain.<ul>
   <li>Each of the Chainlink Nodes then run the requested Job, which will get the price of ETH / USD from their respective data providers. &nbsp;Once each node has an updated price, they will provide that value on-chain.<ul>
       <li>Once each Node Opertor responded on-chain the aggregated answer was recalculated.</li>
       <li>Once each Node Opertor responded on-chain the aggregated answer was recalculated.</li>
Line 35: Line 46:
   </li>
   </li>
</ul>
</ul>
<p>&nbsp;</p>
----
<p></p>
<p>If you are a more visual person, the below diagram may make more sense.</p>
<p>If you are a more visual person, the below diagram may make more sense.</p>
<p><i>An important note, is that the diagram shows just one Chainlink Node, the ETH / USD price feed used three upon launch, then moved to support nine node operators.</i></p>
<p><i>An important note, is that the diagram shows just one Chainlink Node, the ETH / USD price feed used three upon launch, then moved to support nine node operators.</i></p>
<figure class="image image_resized" style="width:27.55%;"><img src="/eth-usd/runlog-diagram.png"></figure>
[[File:Runlog diagram.png|left|thumb]]
<p>&nbsp;</p>
<p> </p>
 
----
<p>Once all of the above took place, the price feed for ETH / USD was updated.</p>
<p>Once all of the above took place, the price feed for ETH / USD was updated.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
Line 48: Line 62:
<p>Each Chainlink Price Feed, with just three Node Operators, required at least 6 on-chain transactions.</p>
<p>Each Chainlink Price Feed, with just three Node Operators, required at least 6 on-chain transactions.</p>
<p>This started exposing potential issues once Chainlink moved each Price Feed from three Node Operators up to nine, we saw that number of on-chain transactions increase to 18 for each update, for each price pair.</p>
<p>This started exposing potential issues once Chainlink moved each Price Feed from three Node Operators up to nine, we saw that number of on-chain transactions increase to 18 for each update, for each price pair.</p>
<p>In times of high market volatility, such as <a href="https://www.coindesk.com/markets/2020/03/12/bitcoin-hits-10-month-low-below-6k-as-stocks-plunge-in-massive-sell-off/">Black Thursday</a>, we saw many people competing with Chainlink Node Operators to get transactions included in blocks. &nbsp;This resulted in exorbitant transaction fees and very high levels of network congestion.</p>
<p>In times of high market volatility, such as [https://www.coindesk.com/markets/2020/03/12/bitcoin-hits-10-month-low-below-6k-as-stocks-plunge-in-massive-sell-off/| Black Thursday], we saw many people competing with Chainlink Node Operators to get transactions included in blocks. &nbsp;This resulted in exorbitant transaction fees and very high levels of network congestion.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>We can see that the Ethereum community was not enjoying the fact that they were competing with the Deviator / Utility node for blockspace.</p>
<p>We can see that the Ethereum community was not enjoying the fact that they were competing with the Deviator / Utility node for blockspace.</p>
<figure class="image"><img src="https://wiki.dextrac.com/eth-usd/screenshot_at_2022-02-21_10-55-52.png"></figure>
[[File:Gas hog.png|left|thumb]]
<p>&nbsp;</p>
----
<p>In addition to the number of transactions per-update, we also see that the Deviator / Utility Node is required to send a single request to each Node Operator's Oracle.sol contract.</p>
<p>In addition to the number of transactions per-update, we also see that the Deviator / Utility Node is required to send a single request to each Node Operator's Oracle.sol contract.</p>
<p>This was another major cost for operating the Price Feeds, while also being a single point of failure.</p>
<p>This was another major cost for operating the Price Feeds, while also being a single point of failure.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Issues with Redundancy</h3>
<h2>Issues with Redundancy</h2>
<p>With the initial deployment of the Price Feeds, Chainlink was required to manage and maintain the Deviator / Utility Node.</p>
<p>With the initial deployment of the Price Feeds, Chainlink was required to manage and maintain the Deviator / Utility Node.</p>
<p>In this model, it was the only way to push requests to the Node Operators to update the ETH / USD price. &nbsp;If the Deviator / Utility Node went offline, ran out of funds, or was rendered inoperable in any way, the Price Feeds would be unable to update.</p>
<p>In this model, it was the only way to push requests to the Node Operators to update the ETH / USD price. &nbsp;If the Deviator / Utility Node went offline, ran out of funds, or was rendered inoperable in any way, the Price Feeds would be unable to update.</p>
<p>This was known to be a point of failure, and addressing it was the highest priority for the team at Chainlink.</p>
<p>This was known to be a point of failure, and addressing it was the highest priority for the team at Chainlink.</p>
<p>The solution?<br><strong>FluxMonitor</strong>.</p>
<p>The solution?<big> [[Flux monitor|FluxMonitor]]</big>


{{:direct_request_resources}}
{{:direct_request_resources}}
<references />
<references />

Latest revision as of 03:43, 11 April 2022

Price Feeds: Direct Request / Runlog (DR)

The first iteration, and quite possibly the most adaptive Chainlink contract was the Direct Request, also referred to as Runlog, model.

This deployment methodology was not specifically designed for price feeds, rather it was designed to enable a wide range of data to be provided on-chain.
As such, it was easy to deploy and maintain, but it was not able to scale efficiently.
Once DeFi protocols started seeing significant levels of adoption, the number of Price Feeds as well as the rate at which they updated started to increase rapidly.

This following section will cover the history of the Direct Request Price Feeds, using the first ever contract ( ETH / USD) as the example.


The First Ever Price Feed: ETH / USD

The original ETH / USD Price Feed was deployed at address - 0x79fEbF6B9F76853EDBcBc913e6aAE8232cFB9De9

With transaction address - 0x9f2791fdc6b1654d593d3ce99a025c0da375541334e26d4ea9215c9cac8a933b

The first three node operators were

Fiews and Link Pool were community members that had made contributions to the Chainlink network before the mainnet launch.

Runlog contracts, also referred to as Direct Request contracts, require that an on-chain request be sent to each Chainlink Node Operator (how this operates is covered in more detail in the RunLog section of the wiki).

As a result of this requirement, the Chainlink Deviator / Utility Node was built. This Chainlink Node had just one purpose; to monitor the price of ETH / USD.  When the price of ETH / USD deviated above a specified threshold, a request was sent to each Node Operator's Oracle.sol contract. This triggered a job run on each of the Nodes, which resulted in an updated price on-chain.


Direct Request Operation

The timeline for these events is as follows:

  • Deviator / Utility Node detects deviation greater than deviation threshold

  • Deviator / Utility Node sends a request to each Chainlink Node's Oracle.sol contract
  • Each Node Operator's Chainlink Node detects the request event on-chain and the specified jobID is run
    • Fiews Job ID:        20c5fc81df974b6d812b3d0a829c8d7f, or in bytes32 0x20c5fc81df974b6d812b3d0a829c8d7f00000000000000000000000000000000
    • LinkPool Job ID:   c142042149f64911bb4698fb08572040, or in bytes32 0xc142042149f64911bb4698fb0857204000000000000000000000000000000000
    • Chainlink Job ID:  lost to the sands of time

  • Each of the Chainlink Nodes then run the requested Job, which will get the price of ETH / USD from their respective data providers.  Once each node has an updated price, they will provide that value on-chain.
    • Once each Node Opertor responded on-chain the aggregated answer was recalculated.

If you are a more visual person, the below diagram may make more sense.

An important note, is that the diagram shows just one Chainlink Node, the ETH / USD price feed used three upon launch, then moved to support nine node operators.

Runlog diagram.png


Once all of the above took place, the price feed for ETH / USD was updated.

 

Price Feeds: Limitations of Direct Request / Runlog

While the Direct Request model was proven to be reliable and supports many more use cases beyond Price Feeds , it was not able to scale very well, and had a single point of failure – the Deviator / Utility Node.

 

Issues with Scaling

Each Chainlink Price Feed, with just three Node Operators, required at least 6 on-chain transactions.

This started exposing potential issues once Chainlink moved each Price Feed from three Node Operators up to nine, we saw that number of on-chain transactions increase to 18 for each update, for each price pair.

In times of high market volatility, such as Black Thursday, we saw many people competing with Chainlink Node Operators to get transactions included in blocks.  This resulted in exorbitant transaction fees and very high levels of network congestion.

 

We can see that the Ethereum community was not enjoying the fact that they were competing with the Deviator / Utility node for blockspace.

Gas hog.png

In addition to the number of transactions per-update, we also see that the Deviator / Utility Node is required to send a single request to each Node Operator's Oracle.sol contract.

This was another major cost for operating the Price Feeds, while also being a single point of failure.

 

Issues with Redundancy

With the initial deployment of the Price Feeds, Chainlink was required to manage and maintain the Deviator / Utility Node.

In this model, it was the only way to push requests to the Node Operators to update the ETH / USD price.  If the Deviator / Utility Node went offline, ran out of funds, or was rendered inoperable in any way, the Price Feeds would be unable to update.

This was known to be a point of failure, and addressing it was the highest priority for the team at Chainlink.

The solution? FluxMonitor

Chainlink ecosystem resources

XXTEXTXX

Timeline

Date Media Author Title
N/A Official Docs Chainlink Direct Request Jobs: Official Chainlink Documentation
XXXX XXXX XXXX []

Educational

Date Media Author Title
XXXX XXXX XXXX []
XXXX XXXX XXXX []
XXXX XXXX XXXX []
XXXX XXXX XXXX []