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

WIP: integrating oracle #2

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 14 additions & 6 deletions .artroll/config/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ query-gas-limit = "0"
pruning = "nothing"

# These are applied if and only if the pruning strategy is custom.
# pruning-keep-recent = "2"
# pruning-interval = "10"
pruning-keep-recent = "0"
pruning-interval = "0"
Comment on lines +24 to +25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove redundant pruning configuration

The pruning-keep-recent and pruning-interval settings are only applied when pruning="custom", but currently pruning="nothing" is set. These settings are redundant and should be removed or commented out.

Additionally, keeping all historical states (pruning="nothing") could lead to significant disk usage over time. Consider if this aligns with your operational requirements.

-pruning-keep-recent = "0"
-pruning-interval = "0"
+# pruning-keep-recent and pruning-interval are only used when pruning="custom"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pruning-keep-recent = "0"
pruning-interval = "0"
# pruning-keep-recent and pruning-interval are only used when pruning="custom"


# HaltHeight contains a non-zero block height at which a node will gracefully
# halt and shutdown that can be used to assist upgrades and testing.
Expand Down Expand Up @@ -99,7 +99,7 @@ enable-hostname-label = false
enable-service-label = false

# PrometheusRetentionTime, when positive, enables a Prometheus metrics sink.
prometheus-retention-time = 1000000000000
prometheus-retention-time = 1000000000000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Reconsider Prometheus retention time

The prometheus-retention-time is set to an extremely high value of 1000000000000 (approximately 31.7 years). This could lead to excessive resource consumption over time.

Consider reducing this value to a more manageable timeframe, such as 30 days (2592000000) or 90 days (7776000000), depending on your specific needs for historical data retention.


# GlobalLabels defines a global set of name/value label tuples applied to all
# metrics emitted using the wrapper functions defined in telemetry package.
Expand Down Expand Up @@ -133,7 +133,7 @@ enable = true
swagger = false

# Address defines the API server to listen on.
address = "tcp://0.0.0.0:1317"
address = "tcp://localhost:1317"

# MaxOpenConnections defines the number of maximum open connections.
max-open-connections = 1000
Expand Down Expand Up @@ -191,7 +191,7 @@ enable = true

# snapshot-interval specifies the block interval at which local state sync snapshots are
# taken (0 to disable).
snapshot-interval = 2000
snapshot-interval = 0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Reconsider disabling state sync snapshots

Setting snapshot-interval = 0 disables state sync snapshots. This configuration change has the following implications:

  1. New nodes will not be able to quickly join the network using state sync.
  2. Nodes will need to sync from genesis or use alternative methods to catch up.

Consider setting a non-zero value (e.g., 1000 or 2000) to enable state sync snapshots, which can significantly reduce the time for new nodes to join the network. If disabling snapshots is intentional, please ensure this aligns with your network's operational requirements.


# snapshot-keep-recent specifies the number of recent snapshots to keep and serve (0 to keep all).
snapshot-keep-recent = 2
Expand Down Expand Up @@ -262,7 +262,7 @@ enable = true
address = "0.0.0.0:8545"

# Address defines the EVM WebSocket server address to bind to.
ws-address = "0.0.0.0:8546"
ws-address = "127.0.0.1:8546"

# API defines a list of JSON-RPC namespaces that should be enabled
# Example: "eth,txpool,personal,net,debug,web3"
Expand Down Expand Up @@ -331,3 +331,11 @@ key-path = ""
[aspect]
apply-pool-size = 0
query-pool-size = 0

[oracle]
enabled = "true"
oracle_address = "localhost:8080"
client_timeout = "250ms"
metrics_enabled = "true"
interval = "1500ms"
price_ttl = "10s"
2 changes: 1 addition & 1 deletion .artroll/config/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ filter_peers = false
[rpc]

# TCP or UNIX socket address for the RPC server to listen on
laddr = "tcp://0.0.0.0:26657"
laddr = "tcp://127.0.0.1:26657"

# A list of origins a cross-domain request can be executed from
# Default value '[]' disables cors support
Expand Down
70 changes: 11 additions & 59 deletions .artroll/config/genesis.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"app_name": "artela-rollkitd",
"app_version": "",
"genesis_time": "2024-08-19T02:50:07.087678Z",
"genesis_time": "2024-10-11T12:58:25.410546222Z",
"chain_id": "artroll_11820-1",
"initial_height": 1,
"app_hash": null,
Expand Down Expand Up @@ -29,31 +29,10 @@
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "art1dq4gtx924wn6k034qfxel0klacty2gd7cktd2j",
"address": "art15cagjnsrq64j5h9p0gx6v8mnch82tu5q4e6v0g",
"pub_key": null,
"account_number": "1",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "art1a2flg0np0fcrjuygyzgzuf6xc3mxct8d9rukzd",
"pub_key": null,
"account_number": "2",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "art1z5jgh3an6hrl7ghdcdftpdztksjxl0gpjsg03v",
"pub_key": null,
"account_number": "3",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "art12uhkvq0axk452ctlvn0q55zgnymq6clml5064g",
"pub_key": null,
"account_number": "4",
"sequence": "0"
}
]
},
Expand All @@ -71,34 +50,7 @@
"coins": []
},
{
"address": "art1z5jgh3an6hrl7ghdcdftpdztksjxl0gpjsg03v",
"coins": [
{
"denom": "aart",
"amount": "100000000000000000000000000"
}
]
},
{
"address": "art12uhkvq0axk452ctlvn0q55zgnymq6clml5064g",
"coins": [
{
"denom": "aart",
"amount": "100000000000000000000000000"
}
]
},
{
"address": "art1dq4gtx924wn6k034qfxel0klacty2gd7cktd2j",
"coins": [
{
"denom": "aart",
"amount": "100000000000000000000000000"
}
]
},
{
"address": "art1a2flg0np0fcrjuygyzgzuf6xc3mxct8d9rukzd",
"address": "art15cagjnsrq64j5h9p0gx6v8mnch82tu5q4e6v0g",
"coins": [
{
"denom": "aart",
Expand Down Expand Up @@ -177,7 +129,7 @@
"shanghai_block": "0",
"cancun_block": "0"
},
"allow_unprotected_txs": true
"allow_unprotected_txs": false
},
"accounts": [
{
Expand Down Expand Up @@ -230,18 +182,18 @@
},
"min_self_delegation": "1",
"delegator_address": "",
"validator_address": "artvaloper1dq4gtx924wn6k034qfxel0klacty2gd7k6rtfd",
"validator_address": "artvaloper15cagjnsrq64j5h9p0gx6v8mnch82tu5qm4j2vh",
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "+SrfTnc7KUBAvp1s2LdutuDBc6kr6+nBCXtzPG7t4VM="
"key": "DLcXY6acqcTnyhnvfycZ4sgSd6b1LhCLPTUux6nl4J4="
},
"value": {
"denom": "aart",
"amount": "1000000000000000000000"
}
}
],
"memo": "[email protected]:26656",
"memo": "[email protected]:26656",
"timeout_height": "0",
"extension_options": [],
"non_critical_extension_options": []
Expand All @@ -251,7 +203,7 @@
{
"public_key": {
"@type": "/artela.crypto.ethsecp256k1.PubKey",
"key": "Awf7YAGa6sZwRCo/iEUoCubZd1dPVYgf5VPGDmjPmNzk"
"key": "A56ZbPnY8Mz3Rbx0l7G+8+S7N/+/xNncR+/hCosrVcuZ"
},
"mode_info": {
"single": {
Expand All @@ -275,7 +227,7 @@
"tip": null
},
"signatures": [
"SjrsqJaKSLJj/Q6zaV4E5h86YYtfkLpb+fCmCfxyz6hgGKRJ7guAC4fBTi0YrbU+wJJZeNZF3akMP+I7k/Pp8AE="
"ROOIMIQmDcfACX13n3cu49HWA9NQKMFAaiDgyyI7BC9QDAdJhhlPWSokM+8x9zR2KSoWIsxEFmWmS6RTBWB/bgA="
]
}
]
Expand Down Expand Up @@ -459,10 +411,10 @@
"consensus": {
"validators": [
{
"address": "CF9A8D94CC8941E4963EA1D441C4BD801C3ADE80",
"address": "3263B152994E439332C7972060DC808637FCC04F",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "+SrfTnc7KUBAvp1s2LdutuDBc6kr6+nBCXtzPG7t4VM="
"value": "DLcXY6acqcTnyhnvfycZ4sgSd6b1LhCLPTUux6nl4J4="
},
"power": "1000000000000000",
"name": "Rollkit Sequencer"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"localtestnet","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"","validator_address":"artvaloper15cagjnsrq64j5h9p0gx6v8mnch82tu5qm4j2vh","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"DLcXY6acqcTnyhnvfycZ4sgSd6b1LhCLPTUux6nl4J4="},"value":{"denom":"aart","amount":"1000000000000000000000"}}],"memo":"[email protected]:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/artela.crypto.ethsecp256k1.PubKey","key":"A56ZbPnY8Mz3Rbx0l7G+8+S7N/+/xNncR+/hCosrVcuZ"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[{"denom":"aart","amount":"4000000000000000"}],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["ROOIMIQmDcfACX13n3cu49HWA9NQKMFAaiDgyyI7BC9QDAdJhhlPWSokM+8x9zR2KSoWIsxEFmWmS6RTBWB/bgA="]}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Address the empty delegator_address field

The delegator_address field in the MsgCreateValidator message is empty. This field should contain the address of the account that will be the initial delegator to the validator.

Please update the JSON object to include the correct delegator_address. For example:

"delegator_address": "art1..."

Replace art1... with the actual delegator address.

🧰 Tools
🪛 Gitleaks

1-1: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

This file was deleted.

2 changes: 1 addition & 1 deletion .artroll/config/node_key.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"/TpLlf6Fl3NxKpur44PVcJvKMs8Qh3dfZaTXeMtOo8sgVj3f4bPC//uYQyqqpKlffUX3t8oDo3AMvIIjds3SdA=="}}
{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"xDZ/luTKfQ1z4ybsLM2E/8dEx1Pqm3Q+r7Ashi2MHIOWpKtLgMi/feOhrJk6w6Gl0kaCDIt37/FSYLlVqD2Gkw=="}}
6 changes: 3 additions & 3 deletions .artroll/config/priv_validator_key.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"address": "CF9A8D94CC8941E4963EA1D441C4BD801C3ADE80",
"address": "3263B152994E439332C7972060DC808637FCC04F",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "+SrfTnc7KUBAvp1s2LdutuDBc6kr6+nBCXtzPG7t4VM="
"value": "DLcXY6acqcTnyhnvfycZ4sgSd6b1LhCLPTUux6nl4J4="
},
"priv_key": {
"type": "tendermint/PrivKeyEd25519",
"value": "yZyMb4PieN4JlHekxUcdy+UTtHMySUar40Wk+JQw9k75Kt9OdzspQEC+nWzYt2624MFzqSvr6cEJe3M8bu3hUw=="
"value": "i/jcH6ADX564vG+4UCtAmZPCuOFfGwn+i7RmaBsJufAMtxdjppypxOfKGe9/JxniyBJ3pvUuEIs9NS7HqeXgng=="
}
}
1 change: 1 addition & 0 deletions .artroll/data/application.db/CURRENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MANIFEST-000000
Empty file.
6 changes: 6 additions & 0 deletions .artroll/data/application.db/LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=============== Oct 15, 2024 (UTC) ===============
16:35:54.242286 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
16:35:54.260593 db@open opening
16:35:54.260913 version@stat F·[] S·0B[] Sc·[]
16:35:54.266628 db@janitor F·2 G·0
16:35:54.266658 db@open done T·6.017062ms
Binary file added .artroll/data/application.db/MANIFEST-000000
Binary file not shown.
1 change: 1 addition & 0 deletions .artroll/data/snapshots/metadata.db/CURRENT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MANIFEST-000000
Empty file.
6 changes: 6 additions & 0 deletions .artroll/data/snapshots/metadata.db/LOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=============== Oct 15, 2024 (UTC) ===============
16:35:54.270126 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed
16:35:54.284041 db@open opening
16:35:54.284453 version@stat F·[] S·0B[] Sc·[]
16:35:54.291261 db@janitor F·2 G·0
16:35:54.291277 db@open done T·7.222854ms
Binary file added .artroll/data/snapshots/metadata.db/MANIFEST-000000
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0xMC0xMSAxMjo1ODoyNS4yNjI2NzY1MTkgKzAwMDAgVVRDIG09KzAuMTMzNzMyNTY3IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiYmxENUU4eW44UXBveFZ6VCJ9.-ocud3CiskV3Qeklub2h6G75-8zgjptHURVtwaD_9JjUXoikVLysJg.QrKxsYN5pIBjmNro.U73Yb0lpp4ZYwuleijzBPUGBiImhIdHK2JMou_FCmYZ-Sc0XJ5_V21JyJwqtUY5Z0xN6hXWLNrjv09px_NAe4jtSzOMRdaw5Laj_JXTcV2gANV9iddW-JtuQ6Nay_-8Nd4NI-AwtOAMXEpvf9ZZLE7SS3lKgcjA7aUq-dqHa2Q2Afx5jXXQYD638GKSHN72KWdenVyXacI7FAJB6tv22YlT7Lcq7GGUhjxB4ITwuLB3Bkr-il8Q.6FGPsZQGAc_0t2PUv8AJtQ

This file was deleted.

2 changes: 1 addition & 1 deletion .artroll/keyring-test/mykey.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0wOC0xOSAxMDo1MDowNi44Mjg4OTQgKzA4MDAgQ1NUIG09KzAuMDUxNjMyODc2IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiaEJZVFJzRU8zQmpxdFZTbiJ9.VP0GUlPTbO5v-u8svOFT86aZHK_11kuDr9UGe9OFPCg0LKvK5WNeVA.t4nkzVN3HUxQp_Br.6i3MWktkEEdWk39G0s4GEV2v-W4sNym0tYCMO7KMYp0tEwUV5hqNtnffxTwJgtFyKurIc85dKdu_LUCZGZvX__T_EKCHciSKCfIMXlmOSKN5HfIhFgRfiDw-rWEDT8kBrIlLJuYJSUmiiEOOak2th_JToA3k4D41N4n2b1gmAREuAVfv39BAogEW1kMXT2wM7xLQie_x7N_mkCxLb3TthqqdqjsM1kRNNJ8gnosKGc4j9s6EQs8HecD8WCJFzTlsaetZdj1M7II3LZtEzapi9mJl4-y4sdBScXLoK6tFjrnXPSExk5mZyYx1ZIleDr4tOu8KcLXsV3e9Ei6d8rn5y172Pz5w_hwUlk247_z-xdWUtP17jvCg7yqf6F4M0iEXZsyLNxYXFoulOq9GmxsBXT6krs4lY7ASrCSBQdqjoYrTrHBBWvf3yFOuko_5-M2gJkXKLQ.TbA6Hh0-6vVgUtQeDKaM1g
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyNC0xMC0xMSAxMjo1ODoyNS4yNjA0NzcyMjcgKzAwMDAgVVRDIG09KzAuMTMxNTMzMjk1IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiemhpaG1IczZ2eG1OYnZoNiJ9.IBLR8TkLBthGPkH9VsP1L18fuiw8qTyrqt6QdSvvvZg8_RGaXu48LA.aClI8LlIw1Rchi0R.kMEJ4pumpaWiy8yilGLS8gln2bD_6Pddz71B8sMuGpb7YuG-TJ1HRsDH1k1ErOGdLrSeDLpgYFve9DpWxxMNe1WTKD1uJkfjtBE5a2SezKs-wtewhj4Ytdzr1RAFrmavTKsy4vrP5SOTrZ_4EMLrvEVF2dHMd5OaNrHVE6prMXYCpyCZ1pGR9OQo_WERJMh0hmvvNIU3S6uUSzM9C9s-X4uzWHfB4wys4KjYZQYWsP96yH3oqbw5BAip9zYs6-UakIJhKBrkc3P--gKNlD67Cz8w48f2hNvxWP2OY4uhhBnda5DkmbEy72Vr_qCW8MPBqW_9eskX8vmuCs98ZxQFiR86XSJXB-0B00nk6GNtpKH_ZW9mgf5VSxqtzztJZunrrr8NjG29m-Vu1EMcsxR3Gbv-BCHCwwqQAm3KUjax6FaOFYtUbOJdxZAXJl36jCDUsgY5lQ.si1-_js6FMcmdUcgjLK5LA
1 change: 0 additions & 1 deletion .artroll/keyring-test/mykey2.info

This file was deleted.

1 change: 0 additions & 1 deletion .artroll/keyring-test/mykey3.info

This file was deleted.

1 change: 0 additions & 1 deletion .artroll/keyring-test/mykey4.info

This file was deleted.

Loading