Skip to content

Commit

Permalink
Merge branch 'main' into ckartik/add-reverting-txnlist
Browse files Browse the repository at this point in the history
  • Loading branch information
ckartik authored Jul 9, 2024
2 parents acc413f + 1ffcb06 commit 2a7cd32
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,13 @@ jobs:
done
done
- name: Upload Cluster Logs
if: ${{ env.IS_MANUAL_DEPLOYMENT == 'false' && failure() }}
- name: Upload Debug Artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: cluster-logs
name: debug-artifacts
path: |
/tmp/dist/
nomad_jobs.json
nomad.log
*_stdout.log
Expand Down
17 changes: 1 addition & 16 deletions infrastructure/nomad/playbooks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -530,21 +530,6 @@
label: "{{ item.path | basename }}"
when: build_artifacts and upload_artifacts.matched > 0 and env == 'devenv'

- name: Read Generated Secrets
slurp:
src: "{{ dist_dir }}/secrets.json"
register: secrets_json
when: build_artifacts and environments[env].secrets == 'generate'
delegate_to: localhost
run_once: true

- name: Debug Generated Secrets
ansible.builtin.debug:
msg: "{{ secrets_json.content | b64decode }}"
when: build_artifacts and env == 'devenv' and environments[env].secrets == 'generate'
delegate_to: localhost
run_once: true

- name: Push Generated Secrets to Vault
ansible.builtin.uri:
url: "{{ vault_address }}/v1/{{ vault_kv_engine_path }}/data/{{ vault_secret_path }}"
Expand All @@ -553,7 +538,7 @@
headers:
X-Vault-Token: "{{ vault_init.json.root_token }}"
Content-Type: "application/json"
body: "{{ {'data': (secrets_json.content | b64decode | from_json)} | to_json }}"
body: "{{ {'data': (lookup('file', dist_dir + '/secrets.json') | from_json)} | to_json }}"
status_code: [200, 204]
validate_certs: no
when: build_artifacts and environments[env].secrets == 'generate'
Expand Down
8 changes: 4 additions & 4 deletions p2p/pkg/rpc/provider/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type ProviderRegistryContract interface {
RegisterAndStake(opts *bind.TransactOpts, blsPublicKey []byte) (*types.Transaction, error)
CheckStake(*bind.CallOpts, common.Address) (*big.Int, error)
MinStake(*bind.CallOpts) (*big.Int, error)
ParseFundsDeposited(types.Log) (*providerregistry.ProviderregistryFundsDeposited, error)
ParseProviderRegistered(types.Log) (*providerregistry.ProviderregistryProviderRegistered, error)
}

type Watcher interface {
Expand Down Expand Up @@ -226,10 +226,10 @@ func (s *Service) RegisterStake(
}

for _, log := range receipt.Logs {
if registration, err := s.registryContract.ParseFundsDeposited(*log); err == nil {
s.logger.Info("stake registered", "amount", registration.Amount)
if registration, err := s.registryContract.ParseProviderRegistered(*log); err == nil {
s.logger.Info("stake registered", "amount", registration.StakedAmount)
return &providerapiv1.StakeResponse{
Amount: registration.Amount.String(),
Amount: registration.StakedAmount.String(),
BlsPublicKey: stake.BlsPublicKey,
}, nil
}
Expand Down
6 changes: 3 additions & 3 deletions p2p/pkg/rpc/provider/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func (t *testRegistryContract) MinStake(_ *bind.CallOpts) (*big.Int, error) {
return t.minStake, nil
}

func (t *testRegistryContract) ParseFundsDeposited(log types.Log) (*providerregistry.ProviderregistryFundsDeposited, error) {
return &providerregistry.ProviderregistryFundsDeposited{
func (t *testRegistryContract) ParseProviderRegistered(log types.Log) (*providerregistry.ProviderregistryProviderRegistered, error) {
return &providerregistry.ProviderregistryProviderRegistered{
Provider: common.Address{},
Amount: t.stake,
StakedAmount: t.stake,
}, nil
}

Expand Down

0 comments on commit 2a7cd32

Please sign in to comment.