Skip to content

Conversation

@MegaRedHand
Copy link
Contributor

Output BatcherPaymentService addresses as JSON

Description

This PR changes the BatcherPaymentService deployment script to follow the convention of outputting the addresses of deployed contracts in a JSON file.

Type of change

Refactor

Checklist

  • “Hotfix” to testnet, everything else to staging
  • Linked to Github Issue
  • This change depends on code or research by an external entity
    • Acknowledgements were updated to give credit
  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.
  • This change is an Optimization
    • Benchmarks added/run
  • Has a known issue
  • If your PR changes the Operator compatibility (Ex: Upgrade prover versions)
    • This PR adds compatibility for operator for both versions and do not change batcher/docs/examples
    • This PR updates batcher and docs/examples to the newer version. This requires the operator are already updated to be compatible

@MegaRedHand MegaRedHand changed the title feat: output BatcherPaymentService addresses as JSON chore: output BatcherPaymentService addresses as JSON Jan 2, 2025
--sig "run(string batcherConfigPath, string outputPath)")

# Extract the batcher payment service values from the output
# new_aligned_layer_service_manager_implementation=$(echo "$forge_output" | awk '/1: address/ {print $3}')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we do the same change as in [contracts/scripts/deploy_batcher_payment_service.sh](https://github.com/yetanotherco/aligned_layer/pull/1698/files#diff-4a582041a459061d1464141cee38003ede0385187a21ad63ffdb01dc84cdf8c5)

Both solutions work, but just for keep consistency

batcher_payment_service_proxy=$(jq -r '.addresses.batcherPaymentService' $BATCHER_PAYMENT_SERVICE_OUTPUT_PATH)
batcher_payment_service_implementation=$(jq -r '.addresses.batcherPaymentServiceImplementation' $BATCHER_PAYMENT_SERVICE_OUTPUT_PATH)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I didn't do it just to minimize the amount of changes. I'll add it in a bit

Copy link
Contributor Author

@MegaRedHand MegaRedHand Jan 7, 2025

Choose a reason for hiding this comment

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

Done. I also removed some stale comments (0c0bbc8), lmk if that's OK

@uri-99
Copy link
Contributor

uri-99 commented Jan 7, 2025

@MegaRedHand Are you aware the batcher payment addresses are currently being outputted in alignedlayer_deployment_output.json ?

@MegaRedHand
Copy link
Contributor Author

MegaRedHand commented Jan 7, 2025

I saw the bash script uses jq to add those addresses to alignedlayer_deployment_output.json, but that doesn't work for me (and would fail if the format changes).

An alternative could be to do that from the Solidity script. I can change to that approach if that seems better.

@uri-99
Copy link
Contributor

uri-99 commented Jan 7, 2025

I saw the bash script uses jq to add those addresses to alignedlayer_deployment_output.json, but that doesn't work for me (and would fail if the format changes).

An alternative could be to do that from the Solidity script. I can change to that approach if that seems better.

If the issue arises from the usage of jq , and it is possible to have the BatcherPayment addresses written in another way, I would try to stick to the existing files structure.

Alternatevly, if we need to have these addresses in another file, we would have to make a big migration since many components read the BatcherPayment addresses from the existing output file.

@MegaRedHand
Copy link
Contributor Author

If the issue arises from the usage of jq , and it is possible to have the BatcherPayment addresses written in another way, I would try to stick to the existing files structure.

Sure! Just to clarify, the changes in this PR don't touch the part that updates the alignedlayer_deployment_output.json file with the BPS addresses. The only difference is that those addresses are also in batcher_deployment_output.json.

Copy link
Collaborator

@JuArce JuArce left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@avilagaston9 avilagaston9 left a comment

Choose a reason for hiding this comment

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

LGTM!

@avilagaston9 avilagaston9 added this pull request to the merge queue Jan 8, 2025
Merged via the queue into staging with commit 3202784 Jan 8, 2025
3 checks passed
@avilagaston9 avilagaston9 deleted the output-batcher-addresses-as-json branch January 8, 2025 19:27
PatStiles pushed a commit that referenced this pull request Jan 9, 2025
PatStiles pushed a commit that referenced this pull request Jan 9, 2025
PatStiles pushed a commit that referenced this pull request Jan 10, 2025
PatStiles pushed a commit that referenced this pull request Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants