@@ -94,26 +94,17 @@ impl SubgraphAvailabilityManagerContract {
94
94
#[ async_trait]
95
95
impl StateManager for RewardsManagerContract {
96
96
async fn deny_many ( & self , denied_status : Vec < ( [ u8 ; 32 ] , bool ) > ) -> Result < ( ) , Error > {
97
- // Based on this gas profile data for `setDeniedMany`:
98
- // gas-used,items
99
- // 4517721,200
100
- // 2271420,100
101
- // 474431,20
102
- // 47642,1
103
- //
104
97
// 100 is considered as a good chunk size.
105
98
for chunk in denied_status. chunks ( 100 ) {
106
99
let ids: Vec < [ u8 ; 32usize ] > = chunk. iter ( ) . map ( |s| s. 0 ) . collect ( ) ;
107
100
let statuses: Vec < bool > = chunk. iter ( ) . map ( |s| s. 1 ) . collect ( ) ;
108
101
let num_subgraphs = ids. len ( ) as u64 ;
109
102
let tx = self
110
103
. contract
111
- . set_denied_many ( ids, statuses)
112
- // To avoid gas estimation errors, we use a high enough gas limit for 100 items
113
- . gas ( ethers:: core:: types:: U256 :: from ( 3_000_000u64 ) ) ;
104
+ . set_denied_many ( ids, statuses) ;
114
105
115
106
if let Err ( err) = tx. call ( ) . await {
116
- let message = err. decode_revert :: < String > ( ) . unwrap ( ) ;
107
+ let message = err. decode_revert :: < String > ( ) . unwrap_or ( err . to_string ( ) ) ;
117
108
error ! ( self . logger, "Transaction failed" ;
118
109
"message" => message,
119
110
) ;
@@ -130,13 +121,6 @@ impl StateManager for RewardsManagerContract {
130
121
#[ async_trait]
131
122
impl StateManager for SubgraphAvailabilityManagerContract {
132
123
async fn deny_many ( & self , denied_status : Vec < ( [ u8 ; 32 ] , bool ) > ) -> Result < ( ) , Error > {
133
- // Based on this gas profile data for `setDeniedMany`:
134
- // gas-used,items
135
- // 4517721,200
136
- // 2271420,100
137
- // 474431,20
138
- // 47642,1
139
- //
140
124
// 100 is considered as a good chunk size.
141
125
for chunk in denied_status. chunks ( 100 ) {
142
126
let ids: Vec < [ u8 ; 32usize ] > = chunk. iter ( ) . map ( |s| s. 0 ) . collect ( ) ;
@@ -145,12 +129,10 @@ impl StateManager for SubgraphAvailabilityManagerContract {
145
129
let oracle_index = U256 :: from ( self . oracle_index ) ;
146
130
let tx = self
147
131
. contract
148
- . vote_many ( ids, statuses, oracle_index)
149
- // To avoid gas estimation errors, we use a high enough gas limit for 100 items
150
- . gas ( U256 :: from ( 3_000_000u64 ) ) ;
132
+ . vote_many ( ids, statuses, oracle_index) ;
151
133
152
134
if let Err ( err) = tx. call ( ) . await {
153
- let message = err. decode_revert :: < String > ( ) . unwrap ( ) ;
135
+ let message = err. decode_revert :: < String > ( ) . unwrap_or ( err . to_string ( ) ) ;
154
136
error ! ( self . logger, "Transaction failed" ;
155
137
"message" => message,
156
138
) ;
0 commit comments