Skip to content

Commit

Permalink
Merge branch 'v3' into nambrot/fix-artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
nambrot authored Oct 23, 2023
2 parents de64a75 + 8e84ef4 commit 9f2b7b1
Show file tree
Hide file tree
Showing 15 changed files with 3,337 additions and 863 deletions.
9 changes: 9 additions & 0 deletions rust/helm/hyperlane-agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{/*
We truncate at 63 chars - (11 + (len $suffix)) because the controller-revision-hash label adds an 11 character suffix
to the pod name, and we want the -validator suffix to still be present, but are happy to truncate the preceding name.
See https://github.com/kubernetes/kubernetes/issues/64023 for controller-revision-hash details.
*/}}
{{- define "validator.fullname" -}}
{{- $suffix := "-validator" }}
{{- include "agent-common.fullname" . | trunc (int (sub 63 (add 11 (len $suffix)))) | trimSuffix "-" }}{{ print $suffix }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "agent-common.fullname" . }}-validator
name: {{ include "validator.fullname" . }}
labels:
{{- include "agent-common.labels" . | nindent 4 }}
data:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: {{ include "agent-common.fullname" . }}-validator-external-secret
name: {{ include "validator.fullname" . }}-external-secret
labels:
{{- include "agent-common.labels" . | nindent 4 }}
annotations:
Expand All @@ -14,7 +14,7 @@ spec:
refreshInterval: "1h"
# The secret that will be created
target:
name: {{ include "agent-common.fullname" . }}-validator-secret
name: {{ include "validator.fullname" . }}-secret
template:
type: Opaque
metadata:
Expand Down
10 changes: 5 additions & 5 deletions rust/helm/hyperlane-agent/templates/validator-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "agent-common.fullname" . }}-validator
name: {{ include "validator.fullname" . }}
labels:
{{- include "agent-common.labels" . | nindent 4 }}
app.kubernetes.io/component: validator
Expand All @@ -12,7 +12,7 @@ spec:
{{- include "agent-common.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: validator
replicas: {{ len .Values.hyperlane.validator.configs }}
serviceName: {{ include "agent-common.fullname" . }}-validator
serviceName: {{ include "validator.fullname" . }}
template:
metadata:
annotations:
Expand Down Expand Up @@ -58,7 +58,7 @@ spec:
- secretRef:
name: {{ include "agent-common.fullname" . }}-secret
- secretRef:
name: {{ include "agent-common.fullname" . }}-validator-secret
name: {{ include "validator.fullname" . }}-secret
env:
- name: REPLICA_NAME
valueFrom:
Expand All @@ -79,10 +79,10 @@ spec:
volumes:
- name: config-env-vars
configMap:
name: {{ include "agent-common.fullname" . }}-validator
name: {{ include "validator.fullname" . }}
- name: secret-env-vars
secret:
secretName: {{ include "agent-common.fullname" . }}-validator-secret
secretName: {{ include "validator.fullname" . }}-secret
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
1 change: 1 addition & 0 deletions solidity/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage.json
out
forge-cache
docs
flattened/
23 changes: 23 additions & 0 deletions solidity/flatten.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
LICENSE="// SPDX-License-Identifier: MIT OR Apache-2.0"

rm -rf flattened
mkdir -p flattened

# flatten contracts
yarn hardhat flatten > flattened/flattened.sol

# remove duplicate licenses
grep -vE "// SPDX.*" flattened/flattened.sol > flattened/delicensed.sol

# add license
echo "$LICENSE" | cat - flattened/delicensed.sol > flattened/licensed.sol

# compile
solc flattened/licensed.sol

# TODO: automate this?
if [ $? -ne 0 ]; then
echo "Remove @openzeppelin/../ICrossDomainMessenger and replace Optimism_Bridge with ICrossDomainMessenger"
echo "Then try compiling again with solc flattened/licensed.sol"
exit 1
fi
6 changes: 1 addition & 5 deletions solidity/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import 'solidity-coverage';
*/
module.exports = {
solidity: {
compilers: [
{
version: '0.8.19',
},
],
version: '0.8.19',
settings: {
optimizer: {
enabled: true,
Expand Down
1 change: 1 addition & 0 deletions solidity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"clean": "hardhat clean && rm -rf ./dist ./cache ./types ./coverage",
"coverage": "./coverage.sh",
"docs": "forge doc",
"flatten": "./flatten.sh",
"prettier": "prettier --write ./contracts ./test",
"test": "hardhat test && forge test -vvv",
"gas": "forge snapshot",
Expand Down
Loading

0 comments on commit 9f2b7b1

Please sign in to comment.