@agoric/cosmos 0.34.1 → 0.34.2-dev-8c14632.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Makefile +2 -3
- package/agoric/config.go +35 -0
- package/ante/ante.go +65 -0
- package/ante/expected_keepers.go +26 -0
- package/ante/fee.go +96 -0
- package/ante/inbound.go +137 -0
- package/ante/inbound_test.go +219 -0
- package/ante/vm_admission.go +64 -0
- package/binding.gyp.in +29 -4
- package/buf.work.yaml +4 -0
- package/cmd/agd/find_binary.go +22 -7
- package/cmd/agd/main.go +2 -3
- package/git-revision.txt +1 -0
- package/go.mod +155 -0
- package/go.sum +1225 -0
- package/package.json +6 -18
- package/tools/tools.go +11 -0
- package/types/events.go +41 -0
- package/upgradegaia.sh +66 -0
- package/vm/controller.go +80 -0
package/binding.gyp.in
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"targets": [
|
|
3
3
|
{
|
|
4
4
|
"target_name": "agcosmosdaemon",
|
|
5
|
+
'variables': {
|
|
6
|
+
"target_lib": "lib<(_target_name).so",
|
|
7
|
+
},
|
|
5
8
|
"cflags!": [ "-fno-exceptions" ],
|
|
6
9
|
"cflags_cc!": [ "-fno-exceptions" ],
|
|
7
10
|
"xcode_settings": {
|
|
@@ -18,17 +21,39 @@
|
|
|
18
21
|
"<!@(node -p \"require('napi-thread-safe-callback').include\")"
|
|
19
22
|
],
|
|
20
23
|
"dependencies": ["<!(node -p \"require('node-addon-api').gyp\")"],
|
|
21
|
-
"libraries": [
|
|
24
|
+
"libraries": [
|
|
25
|
+
"<(target_lib)"
|
|
26
|
+
],
|
|
22
27
|
"conditions": [
|
|
23
28
|
['OS=="mac"', {
|
|
24
29
|
'cflags+': ['-fvisibility=hidden'],
|
|
25
30
|
'xcode_settings': {
|
|
26
31
|
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
|
|
27
|
-
}
|
|
32
|
+
},
|
|
33
|
+
'libraries+': [
|
|
34
|
+
"-Wl,-rpath,@loader_path/..",
|
|
35
|
+
],
|
|
36
|
+
'postbuilds': [
|
|
37
|
+
{
|
|
38
|
+
'postbuild_name': 'Add prefix @rpath/<(target_lib)',
|
|
39
|
+
'action': [
|
|
40
|
+
'install_name_tool',
|
|
41
|
+
'-change',
|
|
42
|
+
'<(target_lib)',
|
|
43
|
+
'@rpath/<(target_lib)',
|
|
44
|
+
'<(PRODUCT_DIR)/<(_target_name).node',
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
],
|
|
28
48
|
}],
|
|
29
49
|
['OS=="win"', {
|
|
30
|
-
'defines': [ '_HAS_EXCEPTIONS=1' ]
|
|
31
|
-
}]
|
|
50
|
+
'defines': [ '_HAS_EXCEPTIONS=1' ],
|
|
51
|
+
}],
|
|
52
|
+
['OS=="linux"', {
|
|
53
|
+
'libraries+': [
|
|
54
|
+
"-Wl,-rpath,'$$ORIGIN/..'",
|
|
55
|
+
],
|
|
56
|
+
}],
|
|
32
57
|
]
|
|
33
58
|
},
|
|
34
59
|
],
|
package/buf.work.yaml
ADDED
package/cmd/agd/find_binary.go
CHANGED
|
@@ -8,14 +8,19 @@ import (
|
|
|
8
8
|
|
|
9
9
|
// FindBinaryNextToMe looks for binName next to the current executable.
|
|
10
10
|
// It returns an absolute filename for binName, or an error.
|
|
11
|
-
func FindBinaryNextToMe(
|
|
11
|
+
func FindBinaryNextToMe(walkUp int, path... string) (string, error) {
|
|
12
12
|
ex, err := os.Executable()
|
|
13
13
|
if err != nil {
|
|
14
14
|
return "", err
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// Calculate the binary's filename.
|
|
18
|
-
|
|
18
|
+
dir := ex
|
|
19
|
+
for i := 0; i <= walkUp; i++ {
|
|
20
|
+
dir = filepath.Dir(dir)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
bin := filepath.Join(append([]string{dir}, path...)...)
|
|
19
24
|
|
|
20
25
|
// Take the absolute path.
|
|
21
26
|
bin, err = filepath.Abs(bin)
|
|
@@ -24,20 +29,30 @@ func FindBinaryNextToMe(binName string) (string, error) {
|
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
// Check that the binary exists.
|
|
27
|
-
if _, err
|
|
32
|
+
if _, err = os.Stat(bin); err != nil {
|
|
28
33
|
return "", err
|
|
29
34
|
}
|
|
35
|
+
|
|
30
36
|
return bin, nil
|
|
31
37
|
}
|
|
32
38
|
|
|
33
|
-
//
|
|
39
|
+
// FindCosmicSwingsetBinary looks for binName in the following locations:
|
|
34
40
|
// 1. The executable's directory
|
|
35
|
-
// 2.
|
|
41
|
+
// 2. Walking up to ../../cosmic-swingset/src/entrypoint.js
|
|
42
|
+
// 3. Walking up to ../../../packages/cosmic-swingset/src/entrypoint.js
|
|
43
|
+
// 4. The system PATH
|
|
36
44
|
//
|
|
37
45
|
// It returns the absolute filename for binName if it is found, otherwise an
|
|
38
46
|
// error.
|
|
39
|
-
func
|
|
40
|
-
|
|
47
|
+
func FindCosmicSwingsetBinary() (string, error) {
|
|
48
|
+
binName := "ag-chain-cosmos"
|
|
49
|
+
if binary, err := FindBinaryNextToMe(0, binName); err == nil {
|
|
50
|
+
return binary, nil
|
|
51
|
+
}
|
|
52
|
+
if binary, err := FindBinaryNextToMe(2, "cosmic-swingset", "src", "entrypoint.js"); err == nil {
|
|
53
|
+
return binary, nil
|
|
54
|
+
}
|
|
55
|
+
if binary, err := FindBinaryNextToMe(3, "packages", "cosmic-swingset", "src", "entrypoint.js"); err == nil {
|
|
41
56
|
return binary, nil
|
|
42
57
|
}
|
|
43
58
|
|
package/cmd/agd/main.go
CHANGED
|
@@ -17,13 +17,12 @@ func main() {
|
|
|
17
17
|
args := []string{"ag-chain-cosmos", "--home", gaia.DefaultNodeHome}
|
|
18
18
|
args = append(args, os.Args[1:]...)
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
binary, lookErr := FindBinary(args[0])
|
|
20
|
+
binary, lookErr := FindCosmicSwingsetBinary()
|
|
23
21
|
if lookErr != nil {
|
|
24
22
|
panic(lookErr)
|
|
25
23
|
}
|
|
26
24
|
|
|
25
|
+
logger.Info("Start chain delegating to JS executable", "binary", binary, "args", args)
|
|
27
26
|
execErr := syscall.Exec(binary, args, os.Environ())
|
|
28
27
|
if execErr != nil {
|
|
29
28
|
panic(execErr)
|
package/git-revision.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
8c14632
|
package/go.mod
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
module github.com/Agoric/agoric-sdk/golang/cosmos
|
|
2
|
+
|
|
3
|
+
go 1.20
|
|
4
|
+
|
|
5
|
+
require (
|
|
6
|
+
github.com/armon/go-metrics v0.4.0
|
|
7
|
+
github.com/cosmos/cosmos-sdk v0.45.11
|
|
8
|
+
github.com/cosmos/gaia/v7 v7.0.0-00010101000000-000000000000
|
|
9
|
+
github.com/cosmos/ibc-go/v3 v3.4.0
|
|
10
|
+
github.com/gogo/protobuf v1.3.3
|
|
11
|
+
github.com/golang/protobuf v1.5.2
|
|
12
|
+
github.com/gorilla/mux v1.8.0
|
|
13
|
+
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
|
14
|
+
github.com/pkg/errors v0.9.1
|
|
15
|
+
github.com/rakyll/statik v0.1.7
|
|
16
|
+
github.com/spf13/cast v1.5.0
|
|
17
|
+
github.com/spf13/cobra v1.6.0
|
|
18
|
+
github.com/stretchr/testify v1.8.0
|
|
19
|
+
github.com/tendermint/tendermint v0.34.23
|
|
20
|
+
github.com/tendermint/tm-db v0.6.7
|
|
21
|
+
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a
|
|
22
|
+
google.golang.org/grpc v1.50.1
|
|
23
|
+
gopkg.in/yaml.v2 v2.4.0
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
require (
|
|
27
|
+
filippo.io/edwards25519 v1.0.0-beta.2 // indirect
|
|
28
|
+
github.com/99designs/keyring v1.1.6 // indirect
|
|
29
|
+
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
|
|
30
|
+
github.com/DataDog/zstd v1.4.5 // indirect
|
|
31
|
+
github.com/Workiva/go-datastructures v1.0.53 // indirect
|
|
32
|
+
github.com/beorn7/perks v1.0.1 // indirect
|
|
33
|
+
github.com/bgentry/speakeasy v0.1.0 // indirect
|
|
34
|
+
github.com/btcsuite/btcd v0.22.1 // indirect
|
|
35
|
+
github.com/cespare/xxhash v1.1.0 // indirect
|
|
36
|
+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
|
|
37
|
+
github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect
|
|
38
|
+
github.com/confio/ics23/go v0.7.0 // indirect
|
|
39
|
+
github.com/cosmos/btcutil v1.0.4 // indirect
|
|
40
|
+
github.com/cosmos/go-bip39 v1.0.0 // indirect
|
|
41
|
+
github.com/cosmos/gorocksdb v1.2.0 // indirect
|
|
42
|
+
github.com/cosmos/iavl v0.19.4 // indirect
|
|
43
|
+
github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect
|
|
44
|
+
github.com/cosmos/ledger-go v0.9.2 // indirect
|
|
45
|
+
github.com/creachadair/taskgroup v0.3.2 // indirect
|
|
46
|
+
github.com/danieljoos/wincred v1.1.0 // indirect
|
|
47
|
+
github.com/davecgh/go-spew v1.1.1 // indirect
|
|
48
|
+
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
|
49
|
+
github.com/dgraph-io/badger/v2 v2.2007.2 // indirect
|
|
50
|
+
github.com/dgraph-io/ristretto v0.0.3 // indirect
|
|
51
|
+
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
|
|
52
|
+
github.com/dustin/go-humanize v1.0.0 // indirect
|
|
53
|
+
github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect
|
|
54
|
+
github.com/felixge/httpsnoop v1.0.2 // indirect
|
|
55
|
+
github.com/fsnotify/fsnotify v1.5.4 // indirect
|
|
56
|
+
github.com/ghodss/yaml v1.0.0 // indirect
|
|
57
|
+
github.com/go-kit/kit v0.12.0 // indirect
|
|
58
|
+
github.com/go-kit/log v0.2.1 // indirect
|
|
59
|
+
github.com/go-logfmt/logfmt v0.5.1 // indirect
|
|
60
|
+
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
|
|
61
|
+
github.com/gogo/gateway v1.1.0 // indirect
|
|
62
|
+
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
|
|
63
|
+
github.com/golang/snappy v0.0.4 // indirect
|
|
64
|
+
github.com/google/btree v1.0.1 // indirect
|
|
65
|
+
github.com/google/gofuzz v1.2.0 // indirect
|
|
66
|
+
github.com/google/orderedcode v0.0.1 // indirect
|
|
67
|
+
github.com/gorilla/handlers v1.5.1 // indirect
|
|
68
|
+
github.com/gorilla/websocket v1.5.0 // indirect
|
|
69
|
+
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
|
70
|
+
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
|
|
71
|
+
github.com/gtank/merlin v0.1.1 // indirect
|
|
72
|
+
github.com/gtank/ristretto255 v0.1.2 // indirect
|
|
73
|
+
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
|
|
74
|
+
github.com/hashicorp/golang-lru v0.5.4 // indirect
|
|
75
|
+
github.com/hashicorp/hcl v1.0.0 // indirect
|
|
76
|
+
github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect
|
|
77
|
+
github.com/improbable-eng/grpc-web v0.14.1 // indirect
|
|
78
|
+
github.com/inconshreveable/mousetrap v1.0.1 // indirect
|
|
79
|
+
github.com/jmhodges/levigo v1.0.0 // indirect
|
|
80
|
+
github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect
|
|
81
|
+
github.com/klauspost/compress v1.15.11 // indirect
|
|
82
|
+
github.com/lib/pq v1.10.6 // indirect
|
|
83
|
+
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
|
|
84
|
+
github.com/magiconair/properties v1.8.6 // indirect
|
|
85
|
+
github.com/mattn/go-colorable v0.1.13 // indirect
|
|
86
|
+
github.com/mattn/go-isatty v0.0.16 // indirect
|
|
87
|
+
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
|
|
88
|
+
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
|
|
89
|
+
github.com/minio/highwayhash v1.0.2 // indirect
|
|
90
|
+
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
|
91
|
+
github.com/mtibben/percent v0.2.1 // indirect
|
|
92
|
+
github.com/pelletier/go-toml v1.9.5 // indirect
|
|
93
|
+
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
|
|
94
|
+
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
|
|
95
|
+
github.com/pmezard/go-difflib v1.0.0 // indirect
|
|
96
|
+
github.com/prometheus/client_golang v1.12.2 // indirect
|
|
97
|
+
github.com/prometheus/client_model v0.2.0 // indirect
|
|
98
|
+
github.com/prometheus/common v0.34.0 // indirect
|
|
99
|
+
github.com/prometheus/procfs v0.8.0 // indirect
|
|
100
|
+
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
|
|
101
|
+
github.com/regen-network/cosmos-proto v0.3.1 // indirect
|
|
102
|
+
github.com/rs/cors v1.8.2 // indirect
|
|
103
|
+
github.com/rs/zerolog v1.27.0 // indirect
|
|
104
|
+
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
|
105
|
+
github.com/spf13/afero v1.8.2 // indirect
|
|
106
|
+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
|
107
|
+
github.com/spf13/pflag v1.0.5 // indirect
|
|
108
|
+
github.com/spf13/viper v1.13.0 // indirect
|
|
109
|
+
github.com/subosito/gotenv v1.4.1 // indirect
|
|
110
|
+
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
|
|
111
|
+
github.com/tendermint/btcd v0.1.1 // indirect
|
|
112
|
+
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect
|
|
113
|
+
github.com/tendermint/go-amino v0.16.0 // indirect
|
|
114
|
+
github.com/zondax/hid v0.9.0 // indirect
|
|
115
|
+
go.etcd.io/bbolt v1.3.6 // indirect
|
|
116
|
+
golang.org/x/crypto v0.1.0 // indirect
|
|
117
|
+
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
|
|
118
|
+
golang.org/x/net v0.7.0 // indirect
|
|
119
|
+
golang.org/x/sys v0.5.0 // indirect
|
|
120
|
+
golang.org/x/term v0.5.0 // indirect
|
|
121
|
+
golang.org/x/text v0.7.0 // indirect
|
|
122
|
+
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
|
|
123
|
+
gopkg.in/ini.v1 v1.67.0 // indirect
|
|
124
|
+
gopkg.in/yaml.v3 v3.0.1 // indirect
|
|
125
|
+
nhooyr.io/websocket v1.8.6 // indirect
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
// Silence a warning on MacOS
|
|
129
|
+
replace github.com/keybase/go-keychain => github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4
|
|
130
|
+
|
|
131
|
+
// At least until post-v0.9.0 is released with
|
|
132
|
+
// https://github.com/Zondax/hid/issues/4 resolved.
|
|
133
|
+
replace github.com/zondax/hid => github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266
|
|
134
|
+
|
|
135
|
+
replace github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76
|
|
136
|
+
|
|
137
|
+
replace github.com/confio/ics23/go => github.com/agoric-labs/cosmos-sdk/ics23/go v0.8.0-alpha.agoric.1
|
|
138
|
+
|
|
139
|
+
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
|
|
140
|
+
|
|
141
|
+
replace google.golang.org/grpc => google.golang.org/grpc v1.33.2
|
|
142
|
+
|
|
143
|
+
// At least until post-v0.34.14 is released with
|
|
144
|
+
// https://github.com/tendermint/tendermint/issue/6899 resolved.
|
|
145
|
+
replace github.com/tendermint/tendermint => github.com/agoric-labs/tendermint v0.34.23-alpha.agoric.3
|
|
146
|
+
|
|
147
|
+
// We need a fork of cosmos-sdk until all of the differences are merged.
|
|
148
|
+
replace github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.45.11-alpha.agoric.3
|
|
149
|
+
|
|
150
|
+
replace github.com/cosmos/gaia/v7 => github.com/Agoric/ag0/v7 v7.0.2-alpha.agoric.1
|
|
151
|
+
|
|
152
|
+
// For testing against a local cosmos-sdk or tendermint
|
|
153
|
+
// replace github.com/cosmos/cosmos-sdk => ../../../forks/cosmos-sdk
|
|
154
|
+
|
|
155
|
+
// replace github.com/tendermint/tendermint => ../../../forks/tendermint
|