Skip to content

Commit

Permalink
Merge pull request #1511 from BalancerMaxis/issue/1374
Browse files Browse the repository at this point in the history
fix: support reporting for multiple gauge adds
  • Loading branch information
gosuto-inzasheru authored Nov 24, 2024
2 parents 8199f58 + 5d596fa commit 5e1206b
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/merge_json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
commit-message: "Combined JSON Payloads ${{ github.event.inputs.runWeek }}"
title: "Combined JSON payloads ${{ github.event.inputs.runWeek }}"
assignees: tritium-vlk
branch: gha-payload-merge
branch: gha-payload-merge-${{ github.event.inputs.runWeek }}
delete-branch: true
labels: "Merged Payloads"

Expand All @@ -52,4 +52,4 @@ jobs:
secrets: inherit
with:
pr_number: ${{ needs.merge_jsons.outputs.pull-request-number }}
checkout_ref: "gha-payload-merge"
checkout_ref: "gha-payload-merge-${{ github.event.inputs.runWeek }}"
22 changes: 22 additions & 0 deletions BIPs/4269-W69/unit_test/add_gauge_eclps/BIP-682.report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FILENAME: `BIPs/4269-W69/unit_test/add_gauge_eclps/BIP-682.json`
MULTISIG: `multisigs/lm (mainnet:0xc38c5f97B34E175FFd35407fc91a937300E33860)`
COMMIT: `e48b0d846281edf7817d908dd966c1727f70f6d2`
CHAIN(S): `mainnet`
TENDERLY: [`πŸŸ₯ FAILURE`](https://www.tdly.co/shared/simulation/b08cbf1e-e460-4687-9789-05f64d9822eb)

| Gauge Validator (0x146b6030E6d6a6398B918E9854652a71C9537180) | Result |
| :------------------------------------------------------------| :----: |
| `validate_preferential_gauge` | βœ… |
| `validate_rate_providers_safety` | βœ… |

```
+-----------------------+---------------------------------------------------------------------+-----------------+--------------------------------------------------+---------------------------------------------------+--------------------------------------------+----------------+---------+----------+
| function | pool_id_and_address | symbol_and_info | gauge_address_and_info | tokens | rate_providers | review_summary | bip | tx_index |
+-----------------------+---------------------------------------------------------------------+-----------------+--------------------------------------------------+---------------------------------------------------+--------------------------------------------+----------------+---------+----------+
| GaugeAdderV4/addGauge | 0x8d93b853849b9884e2bb413444ec23eb5366ee910002000000000000000006b3 | ECLP-sUSDe-GYD | root: 0x146b6030E6d6a6398B918E9854652a71C9537180 | 0x9D39A5DE30e57443BfF2A8307A4256c8797A3497: sUSDe | 0x3A244e6B3cfed21593a5E5B347B593C0B48C7dA1 | safe | BIP-682 | 0 |
| | pool_address: 0x8D93B853849b9884E2Bb413444Ec23eB5366eE91 | fee: 0.15 | side: None | 0xe07F9D810a48ab5c3c914BA3cA53AF14E4491e8A: GYD | 0x0000000000000000000000000000000000000000 | -- | | |
| | | a-factor: N/A | style: mainnet | | | | | |
| | | | cap: 100.0% | | | | | |
| | | | preferential: True | | | | | |
+-----------------------+---------------------------------------------------------------------+-----------------+--------------------------------------------------+---------------------------------------------------+--------------------------------------------+----------------+---------+----------+
```
22 changes: 22 additions & 0 deletions BIPs/4269-W69/unit_test/add_gauge_eclps/BIP-683.report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FILENAME: `BIPs/4269-W69/unit_test/add_gauge_eclps/BIP-683.json`
MULTISIG: `multisigs/lm (mainnet:0xc38c5f97B34E175FFd35407fc91a937300E33860)`
COMMIT: `e48b0d846281edf7817d908dd966c1727f70f6d2`
CHAIN(S): `arbitrum`
TENDERLY: [`πŸŸ₯ FAILURE`](https://www.tdly.co/shared/simulation/12e242d4-694c-4177-88a8-d6c871e729f0)

| Gauge Validator (0xD558C611B69a223767788B638717E868D8947Fd0) | Result |
| :------------------------------------------------------------| :----: |
| `validate_preferential_gauge` | βœ… |
| `validate_rate_providers_safety` | βœ… |

```
+-----------------------+---------------------------------------------------------------------+-------------------+--------------------------------------------------+---------------------------------------------------------+--------------------------------------------+----------------+---------+----------+
| function | pool_id_and_address | symbol_and_info | gauge_address_and_info | tokens | rate_providers | review_summary | bip | tx_index |
+-----------------------+---------------------------------------------------------------------+-------------------+--------------------------------------------------+---------------------------------------------------------+--------------------------------------------+----------------+---------+----------+
| GaugeAdderV4/addGauge | 0x38161e9efb8de52d00a1eb0f773223fd28fdd7c20002000000000000000005a0 | ECLP-GHO-USDe-rh | root: 0xD558C611B69a223767788B638717E868D8947Fd0 | 0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34: USDe | 0x0000000000000000000000000000000000000000 | -- | BIP-683 | 0 |
| | pool_address: 0x38161e9eFb8De52D00A1eB0f773223FD28FDd7c2 | fee: 0.01 | side: 0xcfab2efeF3aFfdd158568DC896115Eac26B3C498 | 0xD9FBA68D89178e3538e708939332c79efC540179: stataArbGHO | 0x177862A0242acD8b5F9cc757a963c1C8883da45E | safe | | |
| | | a-factor: N/A | style: L0 sidechain | | | | | |
| | | | cap: 100.0% | | | | | |
| | | | preferential: True | | | | | |
+-----------------------+---------------------------------------------------------------------+-------------------+--------------------------------------------------+---------------------------------------------------------+--------------------------------------------+----------------+---------+----------+
```
22 changes: 22 additions & 0 deletions BIPs/4269-W69/unit_test/add_gauge_eclps/BIP-684.report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FILENAME: `BIPs/4269-W69/unit_test/add_gauge_eclps/BIP-684.json`
MULTISIG: `multisigs/lm (mainnet:0xc38c5f97B34E175FFd35407fc91a937300E33860)`
COMMIT: `e48b0d846281edf7817d908dd966c1727f70f6d2`
CHAIN(S): `mainnet`
TENDERLY: [`πŸŸ₯ FAILURE`](https://www.tdly.co/shared/simulation/a45b4440-e243-4db3-a45c-78169f259eb8)

| Gauge Validator (0xA00DB7d9c465e95e4AA814A9340B9A161364470a) | Result |
| :------------------------------------------------------------| :----: |
| `validate_preferential_gauge` | βœ… |
| `validate_rate_providers_safety` | βœ… |

```
+-----------------------+---------------------------------------------------------------------+---------------------+--------------------------------------------------+----------------------------------------------------+--------------------------------------------+----------------+---------+----------+
| function | pool_id_and_address | symbol_and_info | gauge_address_and_info | tokens | rate_providers | review_summary | bip | tx_index |
+-----------------------+---------------------------------------------------------------------+---------------------+--------------------------------------------------+----------------------------------------------------+--------------------------------------------+----------------+---------+----------+
| GaugeAdderV4/addGauge | 0x41fdbea2e52790c0a1dc374f07b628741f2e062d0002000000000000000006be | ECLP-stdeUSD-deUSD | root: 0xA00DB7d9c465e95e4AA814A9340B9A161364470a | 0x15700B564Ca08D9439C58cA5053166E8317aa138: deUSD | 0x0000000000000000000000000000000000000000 | -- | BIP-684 | 0 |
| | pool_address: 0x41FDbea2E52790c0a1Dc374F07b628741f2E062D | fee: 0.01 | side: None | 0x5C5b196aBE0d54485975D1Ec29617D42D9198326: sdeUSD | 0x414aB7081D3C2d0BA75703A465744DF99c9f9B22 | safe | | |
| | | a-factor: N/A | style: mainnet | | | | | |
| | | | cap: 100.0% | | | | | |
| | | | preferential: True | | | | | |
+-----------------------+---------------------------------------------------------------------+---------------------+--------------------------------------------------+----------------------------------------------------+--------------------------------------------+----------------+---------+----------+
```
7 changes: 3 additions & 4 deletions action-scripts/brownie/scripts/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def _parse_added_transaction(transaction: dict, **kwargs) -> Optional[dict]:
"review_summary": "\n".join(rate_providers_reviews),
"bip": kwargs.get("bip_number", "N/A"),
"tx_index": kwargs.get("tx_index", "N/A"),
"add_gauge_summary": (is_preferential, rate_providers_reviews),
"add_gauge_summary": (is_preferential, rate_providers_reviews, gauge_address),
}


Expand Down Expand Up @@ -744,6 +744,7 @@ def handler(files: list[dict], handler_func: Callable) -> dict[str, dict]:
outputs = []
tx_list = file["transactions"]
i = 0
add_gauge_summary = []
for transaction in tx_list:
data = handler_func(
transaction,
Expand All @@ -756,9 +757,7 @@ def handler(files: list[dict], handler_func: Callable) -> dict[str, dict]:
)
if data:
if "add_gauge_summary" in data:
add_gauge_summary = data.pop("add_gauge_summary")
else:
add_gauge_summary = None
add_gauge_summary.append(data.pop("add_gauge_summary"))
outputs.append(data)
i += 1
if outputs:
Expand Down
37 changes: 19 additions & 18 deletions action-scripts/brownie/scripts/script_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,24 +453,25 @@ def format_into_report(
file_report += f"TENDERLY: `πŸŸͺ SKIPPED ({repr(e)})`\n\n"

if gauge_checklist:
table = PrettyTable(align="l")
table.set_style(MARKDOWN)
table.field_names = ["Gauge Validator", "Result"]
table.align["Result"] = "c"
is_preferential = "βœ…" if gauge_checklist[0] else "❌"
rate_providers_safety = []
for rate_provider in gauge_checklist[1]:
if rate_provider == "--":
continue
rate_providers_safety.append("βœ…" if rate_provider == "safe" else "❌")
table.add_row([f"`validate_preferential_gauge`", is_preferential])
if len(rate_providers_safety) == 0:
rate_providers_safety = ["--"]
table.add_row(
[f"`validate_rate_providers_safety`", " ".join(rate_providers_safety)]
)
file_report += table.get_string()
file_report += "\n\n"
for gauge_check in gauge_checklist:
table = PrettyTable(align="l")
table.set_style(MARKDOWN)
table.field_names = [f"Gauge Validator ({gauge_check[2]})", "Result"]
table.align["Result"] = "c"
is_preferential = "βœ…" if gauge_check[0] else "❌"
rate_providers_safety = []
for rate_provider in gauge_check[1]:
if rate_provider == "--":
continue
rate_providers_safety.append("βœ…" if rate_provider == "safe" else "❌")
table.add_row([f"`validate_preferential_gauge`", is_preferential])
if len(rate_providers_safety) == 0:
rate_providers_safety = ["--"]
table.add_row(
[f"`validate_rate_providers_safety`", " ".join(rate_providers_safety)]
)
file_report += table.get_string()
file_report += "\n\n"

file_report += "```\n"
file_report += convert_output_into_table(transactions)
Expand Down

0 comments on commit 5e1206b

Please sign in to comment.